Open poplexity opened 1 month ago
Adding more... we currently don't plan to support starting from non-zero genesis and there might be a few places we can just remove our changes entirely, need to confirm with @aamirpashaa which places these would be. (example, storage/db-common
crate)
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-L36Telos 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: https://github.com/telosnetwork/telos-reth/blob/63d23e00982a0ab7704a6dff97b3f5d355e11d56/crates/optimism/node/src/engine.rs#L31-L35
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