Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 2.16 KB

README.md

File metadata and controls

30 lines (21 loc) · 2.16 KB

ChainIO

Interacting with a json-rpc node

We have a basic ethClient which simply wraps geth's ethClient and adds some convenience methods. The Client interface is also implemented by instrumentedClient which adds metrics to the ethClient to conform to the node spec's rpc metrics requirements.

Building Transactions

In order to facilitate reading/writing/subscribing to eigenlayer core contracts and avs registry contracts, we use geth's abigen created bindings for low-level interactions, as well as our own high-level clients with higher utility functions:

  • Eigenlayer Contract Bindings
    • generated by abigen
    • low level bindings to eigenlayer core contracts, which wrap our ethClient
  • ELChainReader / ELChainWriter / ELChainSubscriber
    • wraps bindings and adds convenience methods
    • These structs should be the only ones used by AVS developers, apart from interacting with an ethClient directly to make direct json rpc calls such as waiting for a transaction receipt.

There's a similar setup for the avs registry contracts.

Signing, Sending, and Managing Transactions

After building transactions, we need to sign them, send them to the network, and manage the nonce and gas price to ensure they are mined. This functionality is provided by:

  • txmgr
    • uses a wallet to sign and submit transactions, but then manages them by resubmitting with higher gas prices until they are mined.
  • wallet
    • uses a signerv2 to sign transactions, sends them to the network and can query for their receipts
    • wallet abstraction is needed because "wallets", such as fireblocks, both sign and send transactions to the network (they don't simply return signed bytes so that we can send them ourselves)
  • signerv2
    • signs transactions