-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Ideally all changes are contained in crates within the crates/telos
directory, and not managed via feature flags. This issue is to track investigation into how we could reduce feature flags by moving changes into the telos directory.
If we look at how optimism has added their customizations, we can see there is intentional ways to customize reth which we are not yet using.
Also, where we have implementations in the telos directory which do not involve telos specific changes, we'd like to avoid any code duplication so we do not miss future updates/fixes.
Examples... note that there are likely many more cases we can improve on, which should be added to this issue so we can track their resolution.
-
In the
crates/telos/rpc
crate we implement the EthApi related traits forTelosEthApi
, much of which is done via theself.inner
pattern however in some cases we have not been able use this pattern and had to copy the implementation from ethereum, such as here: https://github.com/telosnetwork/telos-reth/blob/ed53279fec9bc8db2f4e9d4ee7e1968a37162cb2/crates/telos/rpc/src/eth/receipt.rs#L19-L36 -
Telos has additional fields we have added to the engine API, we have done this with feature flags but there is possibly a better way if we look at how optimism has done it here: https://github.com/telosnetwork/telos-reth/blob/ed53279fec9bc8db2f4e9d4ee7e1968a37162cb2/crates/optimism/node/src/node.rs#L113 which then uses their overrides of V3/V4 here:
telos-reth/crates/optimism/node/src/engine.rs
Lines 31 to 35 in 63d23e0
impl EngineTypes for OptimismEngineTypes { type ExecutionPayloadV1 = ExecutionPayloadV1; type ExecutionPayloadV2 = ExecutionPayloadEnvelopeV2; type ExecutionPayloadV3 = OptimismExecutionPayloadEnvelopeV3; type ExecutionPayloadV4 = OptimismExecutionPayloadEnvelopeV4; -
Chainspec related changes for optimism are handled via a custom chainspec implementation here: https://github.com/telosnetwork/telos-reth/blob/ed53279fec9bc8db2f4e9d4ee7e1968a37162cb2/crates/optimism/node/src/node.rs#L109