Skip to content

Sort by Address instead of Keys for Precompile Additions #365

@anusha-ctrl

Description

@anusha-ctrl

When we add a precompile to Subnet-EVM, we create various helper functions to be able to perform precompile upgrades. In params/precompile_config.go we have a function getByKey that takes in a key and returns a precompile.StatefulPrecompileConfig if it exists. When creating a new precompile, a user has to add a new key and a new case in getByKey we can try to reduce as much complexity as possible by simply sorting and searching through precompile addresses. This will reduce the modification to code by 2 if we refactor this correctly. The main goal of this ticket is to have less of these statements in params/precompile_config.go

// ADD YOUR PRECOMPILE HERE

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions