Closed Wodann closed 2 weeks ago
Latest commit: a60e79318138bf2cfeeb84801c823c5c0a625f45
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
This PR adds a
trait ChainSpec
toedr_evm
that allows specification of chain-specific internal/engine types. For now, we only deal with with L1 Ethereum.Future work will implement a block builder and miner for Optimism and abstract that using a trait.
I used three traits
IntoRemoteBlock
,EthRpcBlock
, andEthRpcTransaction
to access the values that are required for state and blockchain implementations. I don't think this is particularly elegant, especially theIntoRemoteBlock
but I wasn't sure what better way to abstract them.I'm open to suggestions for how I might be better able to abstract the information that needs to be retrieved from
ChainSpec::RpcBlock
. For now I stuck with this design, as it's hard to predict what this will look like with more chain types. As it stands, it is relatively easy to change the API in the future; e.g. if another chain type requires access to more properties of the RPC block or transaction.