-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into feat-improve-bls-logging
- Loading branch information
Showing
42 changed files
with
3,646 additions
and
1,215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,30 @@ | ||
## ChainIO | ||
|
||
This module is used to facilitate reading/writing/subscribing to [eigenlayer core](./clients/elcontracts/) contracts and [avs registry](./clients/avsregistry/) contracts. | ||
|
||
To make it easier to understand the different structs in this package, and their hierarchical relationship, we describe each of them below: | ||
- geth's ethClient | ||
- eigensdk [ethClient](./clients/eth/client.go) | ||
- wraps geth's ethClient and adds convenience methods | ||
- [eigenlayerContractBindings](../contracts/bindings/) | ||
### Interacting with a json-rpc node | ||
|
||
We have a basic [ethClient](./clients/eth/client.go) which simply wraps geth's ethClient and adds some convenience methods. The Client interface is also implemented by [instrumentedClient](./clients/eth/instrumented_client.go) which adds metrics to the ethClient to conform to the node spec's [rpc metrics](https://docs.eigenlayer.xyz/eigenlayer/avs-guides/spec/metrics/metrics-prom-spec#rpc-metrics) requirements. | ||
|
||
|
||
### Building Transactions | ||
|
||
In order to facilitate reading/writing/subscribing to [eigenlayer core](./clients/elcontracts/) contracts and [avs registry](./clients/avsregistry/) 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](./clients/elcontracts/bindings.go) | ||
- generated by abigen | ||
- low level bindings to eigenlayer core contracts, which wrap our ethClient | ||
- [elContractsClient](./clients/eth/client.go) | ||
- wraps eigenlayerContractBindings and hides a little bit of the underlying complexity, which is not needed in 99% of cases. | ||
- abigen also doesn't create an interface for the bindings it generates, whereas elContractsClient has a well defined interface which we use to generate mocks to help with testing. | ||
- [ELChainReader](./clients/elcontracts/reader.go) / [ELChainWriter](./clients/elcontracts/writer.go) / [ELChainSubscriber](./clients/avsregistry/subscriber.go) | ||
- wraps elContractsClient and adds convenience methods | ||
- hides even more complexity than elContractsClient | ||
- 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. | ||
|
||
A similar hierarchy applies for the avs registry contracts. | ||
There's a similar setup for the [avs registry](./clients/avsregistry/) 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](./txmgr/README.md) | ||
- uses a wallet to sign and submit transactions, but then manages them by resubmitting with higher gas prices until they are mined. | ||
- [wallet](./clients/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](../signerv2/README.md) | ||
- signs transactions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.