ava-labs / subnet-evm

Launch your own EVM as an Avalanche Subnet
https://docs.avax.network/subnets/create-a-fuji-subnet
GNU Lesser General Public License v3.0
237 stars 213 forks source link

Deprecate active precompiles #1186

Closed ceyonur closed 1 month ago

ceyonur commented 1 month ago

Why this should be merged

This PR deprecates eth_getActivatedPrecompilesAt in favor of eth_getActiveRulesAt and expands the API.

https://docs.avax.network/reference/subnet-evm/api#eth_getactiverulesat

How this works

Added precompiles to getActiveRulesAt API:

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "ethRules": {
            "IsHomestead": true,
            "IsEIP150": true,
            "IsEIP155": true,
            "IsEIP158": true,
            "IsByzantium": true,
            "IsConstantinople": true,
            "IsPetersburg": true,
            "IsIstanbul": true,
            "IsCancun": false
        },
        "avalancheRules": {
            "IsSubnetEVM": true,
            "IsDurango": false,
            "IsEUpgrade": false
        },
        "precompiles": {
            "contractNativeMinterConfig": {
                "timestamp": 0
            }
        }
    }
}

How this was tested

Locally

How is this documented

Documents PR: https://github.com/ava-labs/avalanche-docs/pull/1771