Different roots in header use different algorithms, and not Eth2.0-compatible #1342
yangby-cryptape
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Contact Details
No response
Current Behavior
Different roots in block header use different algorithms and different default values.
The default value for
TrieMerkle.root_hash
, when there are no data, ishash(rlp(null))
.Ref: citahub/cita-trie
Transactions root for empty list is
hash(rlp(null))
.axon/core/consensus/src/engine.rs
Lines 71 to 79 in 4ef2f56
I checked that
RLP_NULL == hash(rlp(null))
, and a unit test will be added later.Receipts root for empty list is
hash(rlp(null))
.axon/core/executor/src/lib.rs
Lines 191 to 195 in 4ef2f56
Signed transactions hash for empty list is
hash(rlp([]))
.axon/core/consensus/src/engine.rs
Line 86 in 4ef2f56
axon/core/consensus/src/util.rs
Lines 17 to 19 in 4ef2f56
Default value for
metadata_root
andcell_header_root
is0x0000..0000
.axon/core/executor/src/adapter/mod.rs
Lines 287 to 293 in 4ef2f56
axon/core/executor/src/adapter/mod.rs
Lines 189 to 213 in 4ef2f56
Ethereum has defined the following roots, as of today (2023-08-15):
transactions_root
Eth1.0: Default value is
hash(rlp(null))
.Eth2.0: Default value is
ssz_root(null)
.Ref: EIP-6404.
receipts_root
Default value is
hash(rlp(null))
.Expected Behavior
Default values:
transactions_root
:hash(rlp(null))
receipts_root
:hash(rlp(null))
.signed_txs_hash
:hash(rlp([]))
Different with above roots, the inner is an empty list.
metadata_root
:H256::default()
.metadata_root
should be treated as an optional value:H256::default()
means it's null.hash(rlp(null))
is the default value when it's not null.cell_header_root
:H256::default()
.Same as
metadata_root
.OS
Not Associated
Axon version
No response
Kernel
Not Associated
Relevant log output
No response
Anything else?
Since Axon uses MPT root for all roots, but Ethereum uses SSZ root for all roots.
Maybe Axon has to update the
README.md
as following:Beta Was this translation helpful? Give feedback.
All reactions