Skip to content

Support read precompiles in debug/trace APIs on latest block #26

Description

@sprites0

Describe the feature

add or extend an ETH RPC to support read precompile calls in eth_call and eth_estimateGas on the latest block, as wallets may need this

Rough idea: extend call_forwarder to use local EVM with "read precompile forwarder" to hl-node - affecting eth_call and eth_estimateGas on the latest block.

  • Write an latest-block only EVM environment that
    • Fetches the highest_precompile_address of latest block (or just treat all 0x8.. as precompile)
    • For those precompile addresses between 0x800..[highest], install precompiles that forwards input + gas limit to local hl-node and gets the result
    • If it returns PrecompileError, spend all gas limit then return out-of-gas error.
    • (Optional) After eth_call is complete, since those eth_calls to hl-node were not atomic (block number might be changed), run it again with batched multicall (or contract creation call) to hl-node to get all used values atomically.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions