perama-v / archors Goto Github PK
View Code? Open in Web Editor NEWA tool for single Ethereum archival block state proofs.
License: Apache License 2.0
A tool for single Ethereum archival block state proofs.
License: Apache License 2.0
When executing a block using proof-based state data:
There appears to be insufficient information to construct post-block state root.
There are situations where a key is being removed from the trie during block execution. When a leaf node is
one of two children of a branch node, that branch node is now not required.
It can be seen that branch A would only have one child if the leaf were removed.
flowchart TD
A[some traversal ...] --> B[extension 'abc'] --> F[branch A]
F --item 1--> C[extension '2345'] --> D[branch B]
F --item d--> E[leaf being deleted with path '...abcdef']
The updated trie needs:
flowchart TD
A[some traversal ...] --> B[extension 'abc12345'] --> D[branch B]
However, the trie is represented as a merkle multiproof, either for
Nodes not accessed during block execution, such as branch A and extension '2345' are not present.
Here is what is present:
flowchart TD
A[some traversal ...] --> B[extension 'abc'] --> F[branch A]
F -.item 1.-> C[hash of extension '2345']
F --item d--> E[leaf being deleted with path '...abcdef']
So it is not possible to know the contents of extension '2345' (perhaps it is '2', or '23456'). Hence
the two extensions cannot be combined. This prevents hashes from being known all the way back to the root.
One could execute a block without trusting a third party, but verification of the post-block state root would not be possible locally.
As blocks are deterministic this represents a loss of a nice sanity check for correct local block execution.
However the results of the EVM execution (full block trace) can still be obtained completely.
To create the set of archival block state proofs both debug_traceTransaction
and eth_getProof
are required.
Roles:
debug_traceTransaction
with prestateTracer
applied to all transactions in a block allows the full set of required states to be computed. These are the "accessed states" and includes storage slots for each account, aggregated for the block.eth_getProof
can be passed the "accessed states" for accounts individually. The result includes the account storage proofs that are used for that block. The proofs are then used to construct the final state proof for the block.eth_getProof
debug_traceTransaction
with prestateTracer
The EVM has access to the blockhash of the prior 256 blocks.
Need to handle how the tracing works when thus opcode is encountered. Options:
There is a bug in the state transition or state root update logic. Applying the block 17190873 transactions and updating the multiproof results in a hash that does not match that present in the header for 17190873.
State access count is likely linearly related to gas used. This metric would give more extrapolatable findings
archors describes an architecture where an archive node is distributed at the block level (bundles containing all the state required to execute the bloc, and accompanying proofs).
A user can just download the blocks that are relevant to them.
How do they know which blocks? This is a discovery problem cleverly solved by the UnchainedIndex https://github.com/TrueBlocks/trueblocks-core:
chifra list my_address
Related, if the discovery problem is solved by a JSON-RPC method on archive nodes themselves (https://github.com/perama-v/eth_getAddressAppearances), then whatever distribution system
for distributing the archive node data (e.g., portal network), may also want to include a native version of this index of address appearances (holding a portion of the index, as determined by their node_id).
This should be included in docs
At present the state data (proof) is for the block prior to the current block. The block transactions are applied to this state. That
results in the state root in the current block.
The proof from the prior block can be updated by tracking the state changes after each transaction. After the last
transaction the state root can be checked to match that which is in the header.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.