Tezlink: empty Tezos blocks
Context
The goal of this milestone is to bootstrap the work on Tezos compatibility in Tezlink by building the infrastructure on which we will iterate in the next milestones. The focus is on turning the (multichain) EVM node into a generic L2 node which can handle both Ethereum and Tezos RPC calls depending on the chain family of the targeted L2 chain.
In order to keep the current rollup tests passing, the RPC server of the Michelson chain family will start as a clone of the EVM one from which the JSON RPCs will be progressively replaced by Tezos ones. The goal of this milestone is to have one such RPC replaced.
Work breakdown
Configuration
When executing the kernel, we want the following logic:
- first read the feature flag from durable storage,
- if it's enabled then:
- for each chain_id from
/evm/chain_idsread thechain_familyand the chain config from/evm/chain_configurations/<chain_id>,
- for each chain_id from
- else:
- read the chain_id from
/evm/chain_idand the chain config from/evm.
- read the chain_id from
In the L2 node however, which chain_id the node follows is not an information which comes from the durable storage so we want something like:
- read the list of chain ids and the mode from the config file,
- read the feature flag from durable storage,
- if it's enabled then:
- in sequencer mode:
- check that the list of chain ids is identical to the one stored in
/evm/chain_ids - launch restricted RPC server
- check that the list of chain ids is identical to the one stored in
- in non-sequencer mode:
- check that the list of chain ids from config is a singleton,
- get the chain family for this chain_id,
- launch RPC server for this family
- in sequencer mode:
- else:
- check that the "l2_chains" experimental feature is disabled
- check that
/evm/chain_idhas the expected chain_id - launch an RPC server for the EVM family.
-
Add a chain_familyfield whose value is either "EVM" or "Michelson" to themake l2 kernel installer configcommand of the L2 node. !16702 (merged) @luciano.freitas -
When the feature flag is enabled, the kernel can read the chain family and put it in its configuration: !16778 (merged) @ArnaudBihan -
The L2 node can read the chain family from the durable storage: !16988 (merged) @luciano.freitas -
Add a debug JSON RPC to get the chain family: !16757 (merged) @luciano.freitas
L2 node (formerly known as EVM node)
Renaming
-
The octez-evm-nodebinary is renamed intooctez-l2-node. To avoid breaking existing scripts, the old name is kept and links to the new one. @rafoo_
Sequencer
The notion of chain family does not make sense in the case of the sequencer because the sequencer will eventually have to run both chains. When the multichain feature flag is enabled, we want the sequencer to only answer to very few RPCs but we can run L2 nodes in RPC mode to provide a RPC view of a specific chain family (on a specific chain).
-
Wrap the sequencer into a RPC L2 node in tezt integration tests: !16980 (closed)!17058 (merged) @luciano.freitas -
Read the feature flag from the durable storage: !16993 (merged) @luciano.freitas -
When the feature flag is activated, restrict the set of RPCs exposed directly by the sequencer: !16906 (closed)!16991 (merged) @luciano.freitas
First Tezos RPCs
Initially, the RPC service will be the same for EVM and Michelson. As the project progresses, JSON RPCs will be dropped in favor of native tezos RPCs for the Michelson family. The goal of this milestone is do complete this replacement for one RPC: eth_blockNumber replaced by /chain/main/blocks/head/context/helpers/current_level.
-
Make the L2 node depend on the Quebec protocol: !17082 (merged) @pe.cornilleau -
For non-sequencer modes, in the Michelson case, expose all the RPCs needed for the demo by importing their services from the protocol and the RPC plugin of the octez node. @pe.cornilleau -
Implement the current_levelservice: !17072 (merged) @luciano.freitas.-
For now, let's hardcode the cycle length and implement the service like it's done in ToT:
-
-
Add a Tezt wrapper taking the chain family as argument and calling Rpc.block_numberin theEVMcase andCurl.get ~args:["chains"; "main"; "blocks"; "head"; "context"; "helpers"; "current_level"]in theMichelsoncase. @luciano.freitas -
Mark the eth_blockNumberas unsupported in the Michelson case. @luciano.freitas
Kernel
-
limit the amount of chain-specific information handled before block application @rafoo_ -
avoid reading the last block to validate next blueprint: !16999 (merged) -
avoid reading the last block when there is a BIP in storage: !16996 (merged) -
introduce block header: !17000 (merged) -
avoid reading the last block in stage 2: !17119 (merged) !17120 (merged) !17121 (merged) !17122 (merged) !16835 (merged) -
split rollup concepts from L2 concepts: !16972 (merged)
-
-
introduce a trait to generalize the chain-specific notions which need to be understood before stage 2 (transactions, transaction hashes, block hashes, blueprints) @ArnaudBihan-> not now -
Blueprints for L2 chains of family "Michelson" must be empty: !17040 (merged) !17153 (merged) !17159 (merged) @ArnaudBihan