-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove multi provider trait functions in rpc helper traits #11422
Comments
something like this would be helpful: https://github.com/paradigmxyz/reth/pull/10616/files then moving all the getters in removing this redundancy at the price of making the the trait bounds less precise, isn't helpful. Some rollups won't use all the besides it makes it harder to build unit tests for this code, which we should aim to do despite hive test coverage. |
right, #10616 is more or less the unlock here, or similar at least |
This issue is stale because it has been open for 21 days with no activity. |
Describe the feature
we compose various rpc traits with default impls
like:
reth/crates/rpc/rpc-eth-api/src/helpers/trace.rs
Line 22 in a07efa7
these are effective stacked traits.
currently we have some functions multiple times:
reth/crates/rpc/rpc-eth-api/src/helpers/trace.rs
Line 26 in a07efa7
reth/crates/rpc/rpc-eth-api/src/helpers/call.rs
Line 459 in a07efa7
or
reth/crates/rpc/rpc-eth-api/src/helpers/transaction.rs
Line 56 in a07efa7
reth/crates/rpc/rpc-eth-api/src/helpers/pending_block.rs
Lines 47 to 52 in a07efa7
resulting in some inconvenient usage and restrictions.
like:
reth/crates/rpc/rpc-eth-api/src/helpers/block.rs
Line 154 in a07efa7
ideally we only have one evm_config and one provider function, perhaps in a single trait that sits at the bottom of the stack, these should like by an associated type and we can easily implement this because we have this generic:
reth/crates/rpc/rpc/src/eth/helpers/transaction.rs
Lines 13 to 23 in a07efa7
and it is expected that the final provider is then the full provider that satisfies all traits.
the stacked traits can then add the required bounds
then we can force the required trait bounds on Trace for example
Additional context
No response
Tasks
EthApiSpec
#12050RpcNodeCore
as supertrait forLoadState
#12094Call::evm_config
#12095RpcNodeCore
toLoadPendingBlock
#12098LoadBlock::provider
#12100RpcNodeCore
toLoadTransaction
#12104Trace::evm_config
#12102EthBlocks::provider
#12109EthTransactions::provider
#12121LoadFee::provider
#12122The text was updated successfully, but these errors were encountered: