Giter VIP home page Giter VIP logo

gballet / go-ethereum Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ethereum/go-ethereum

21.0 5.0 13.0 208.76 MB

Official Go implementation of the Ethereum protocol

Home Page: https://geth.ethereum.org

License: GNU Lesser General Public License v3.0

Makefile 0.06% Go 89.48% Shell 0.22% NSIS 0.18% HTML 0.09% JavaScript 3.34% M4 0.20% C 5.10% Python 0.08% Assembly 0.72% Java 0.23% Dockerfile 0.01% Solidity 0.07% Sage 0.23%

go-ethereum's Introduction

Go Ethereum

Official Golang execution layer implementation of the Ethereum protocol.

API Reference Go Report Card Travis Discord

Automated builds are available for stable releases and the unstable master branch. Binary archives are published at https://geth.ethereum.org/downloads/.

Building the source

For prerequisites and detailed build instructions please read the Installation Instructions.

Building geth requires both a Go (version 1.19 or later) and a C compiler. You can install them using your favourite package manager. Once the dependencies are installed, run

make geth

or, to build the full suite of utilities:

make all

Executables

The go-ethereum project comes with several wrappers/executables found in the cmd directory.

Command Description
geth Our main Ethereum CLI client. It is the entry point into the Ethereum network (main-, test- or private net), capable of running as a full node (default), archive node (retaining all historical state) or a light node (retrieving data live). It can be used by other processes as a gateway into the Ethereum network via JSON RPC endpoints exposed on top of HTTP, WebSocket and/or IPC transports. geth --help and the CLI page for command line options.
clef Stand-alone signing tool, which can be used as a backend signer for geth.
devp2p Utilities to interact with nodes on the networking layer, without running a full blockchain.
abigen Source code generator to convert Ethereum contract definitions into easy-to-use, compile-time type-safe Go packages. It operates on plain Ethereum contract ABIs with expanded functionality if the contract bytecode is also available. However, it also accepts Solidity source files, making development much more streamlined. Please see our Native DApps page for details.
bootnode Stripped down version of our Ethereum client implementation that only takes part in the network node discovery protocol, but does not run any of the higher level application protocols. It can be used as a lightweight bootstrap node to aid in finding peers in private networks.
evm Developer utility version of the EVM (Ethereum Virtual Machine) that is capable of running bytecode snippets within a configurable environment and execution mode. Its purpose is to allow isolated, fine-grained debugging of EVM opcodes (e.g. evm --code 60ff60ff --debug run).
rlpdump Developer utility tool to convert binary RLP (Recursive Length Prefix) dumps (data encoding used by the Ethereum protocol both network as well as consensus wise) to user-friendlier hierarchical representation (e.g. rlpdump --hex CE0183FFFFFFC4C304050583616263).

Running geth

Going through all the possible command line flags is out of scope here (please consult our CLI Wiki page), but we've enumerated a few common parameter combos to get you up to speed quickly on how you can run your own geth instance.

Hardware Requirements

Minimum:

  • CPU with 2+ cores
  • 4GB RAM
  • 1TB free storage space to sync the Mainnet
  • 8 MBit/sec download Internet service

Recommended:

  • Fast CPU with 4+ cores
  • 16GB+ RAM
  • High-performance SSD with at least 1TB of free space
  • 25+ MBit/sec download Internet service

Full node on the main Ethereum network

By far the most common scenario is people wanting to simply interact with the Ethereum network: create accounts; transfer funds; deploy and interact with contracts. For this particular use case, the user doesn't care about years-old historical data, so we can sync quickly to the current state of the network. To do so:

$ geth console

This command will:

  • Start geth in snap sync mode (default, can be changed with the --syncmode flag), causing it to download more data in exchange for avoiding processing the entire history of the Ethereum network, which is very CPU intensive.
  • Start the built-in interactive JavaScript console, (via the trailing console subcommand) through which you can interact using web3 methods (note: the web3 version bundled within geth is very old, and not up to date with official docs), as well as geth's own management APIs. This tool is optional and if you leave it out you can always attach it to an already running geth instance with geth attach.

A Full node on the Görli test network

Transitioning towards developers, if you'd like to play around with creating Ethereum contracts, you almost certainly would like to do that without any real money involved until you get the hang of the entire system. In other words, instead of attaching to the main network, you want to join the test network with your node, which is fully equivalent to the main network, but with play-Ether only.

$ geth --goerli console

The console subcommand has the same meaning as above and is equally useful on the testnet too.

Specifying the --goerli flag, however, will reconfigure your geth instance a bit:

  • Instead of connecting to the main Ethereum network, the client will connect to the Görli test network, which uses different P2P bootnodes, different network IDs and genesis states.
  • Instead of using the default data directory (~/.ethereum on Linux for example), geth will nest itself one level deeper into a goerli subfolder (~/.ethereum/goerli on Linux). Note, on OSX and Linux this also means that attaching to a running testnet node requires the use of a custom endpoint since geth attach will try to attach to a production node endpoint by default, e.g., geth attach <datadir>/goerli/geth.ipc. Windows users are not affected by this.

Note: Although some internal protective measures prevent transactions from crossing over between the main network and test network, you should always use separate accounts for play and real money. Unless you manually move accounts, geth will by default correctly separate the two networks and will not make any accounts available between them.

Configuration

As an alternative to passing the numerous flags to the geth binary, you can also pass a configuration file via:

$ geth --config /path/to/your_config.toml

To get an idea of how the file should look like you can use the dumpconfig subcommand to export your existing configuration:

$ geth --your-favourite-flags dumpconfig

Note: This works only with geth v1.6.0 and above.

Docker quick start

One of the quickest ways to get Ethereum up and running on your machine is by using Docker:

docker run -d --name ethereum-node -v /Users/alice/ethereum:/root \
           -p 8545:8545 -p 30303:30303 \
           ethereum/client-go

This will start geth in snap-sync mode with a DB memory allowance of 1GB, as the above command does. It will also create a persistent volume in your home directory for saving your blockchain as well as map the default ports. There is also an alpine tag available for a slim version of the image.

Do not forget --http.addr 0.0.0.0, if you want to access RPC from other containers and/or hosts. By default, geth binds to the local interface and RPC endpoints are not accessible from the outside.

Programmatically interfacing geth nodes

As a developer, sooner rather than later you'll want to start interacting with geth and the Ethereum network via your own programs and not manually through the console. To aid this, geth has built-in support for a JSON-RPC based APIs (standard APIs and geth specific APIs). These can be exposed via HTTP, WebSockets and IPC (UNIX sockets on UNIX based platforms, and named pipes on Windows).

The IPC interface is enabled by default and exposes all the APIs supported by geth, whereas the HTTP and WS interfaces need to manually be enabled and only expose a subset of APIs due to security reasons. These can be turned on/off and configured as you'd expect.

HTTP based JSON-RPC API options:

  • --http Enable the HTTP-RPC server
  • --http.addr HTTP-RPC server listening interface (default: localhost)
  • --http.port HTTP-RPC server listening port (default: 8545)
  • --http.api API's offered over the HTTP-RPC interface (default: eth,net,web3)
  • --http.corsdomain Comma separated list of domains from which to accept cross origin requests (browser enforced)
  • --ws Enable the WS-RPC server
  • --ws.addr WS-RPC server listening interface (default: localhost)
  • --ws.port WS-RPC server listening port (default: 8546)
  • --ws.api API's offered over the WS-RPC interface (default: eth,net,web3)
  • --ws.origins Origins from which to accept WebSocket requests
  • --ipcdisable Disable the IPC-RPC server
  • --ipcapi API's offered over the IPC-RPC interface (default: admin,debug,eth,miner,net,personal,txpool,web3)
  • --ipcpath Filename for IPC socket/pipe within the datadir (explicit paths escape it)

You'll need to use your own programming environments' capabilities (libraries, tools, etc) to connect via HTTP, WS or IPC to a geth node configured with the above flags and you'll need to speak JSON-RPC on all transports. You can reuse the same connection for multiple requests!

Note: Please understand the security implications of opening up an HTTP/WS based transport before doing so! Hackers on the internet are actively trying to subvert Ethereum nodes with exposed APIs! Further, all browser tabs can access locally running web servers, so malicious web pages could try to subvert locally available APIs!

Operating a private network

Maintaining your own private network is more involved as a lot of configurations taken for granted in the official networks need to be manually set up.

Defining the private genesis state

First, you'll need to create the genesis state of your networks, which all nodes need to be aware of and agree upon. This consists of a small JSON file (e.g. call it genesis.json):

{
  "config": {
    "chainId": <arbitrary positive integer>,
    "homesteadBlock": 0,
    "eip150Block": 0,
    "eip155Block": 0,
    "eip158Block": 0,
    "byzantiumBlock": 0,
    "constantinopleBlock": 0,
    "petersburgBlock": 0,
    "istanbulBlock": 0,
    "berlinBlock": 0,
    "londonBlock": 0
  },
  "alloc": {},
  "coinbase": "0x0000000000000000000000000000000000000000",
  "difficulty": "0x20000",
  "extraData": "",
  "gasLimit": "0x2fefd8",
  "nonce": "0x0000000000000042",
  "mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "timestamp": "0x00"
}

The above fields should be fine for most purposes, although we'd recommend changing the nonce to some random value so you prevent unknown remote nodes from being able to connect to you. If you'd like to pre-fund some accounts for easier testing, create the accounts and populate the alloc field with their addresses.

"alloc": {
  "0x0000000000000000000000000000000000000001": {
    "balance": "111111111"
  },
  "0x0000000000000000000000000000000000000002": {
    "balance": "222222222"
  }
}

With the genesis state defined in the above JSON file, you'll need to initialize every geth node with it prior to starting it up to ensure all blockchain parameters are correctly set:

$ geth init path/to/genesis.json

Creating the rendezvous point

With all nodes that you want to run initialized to the desired genesis state, you'll need to start a bootstrap node that others can use to find each other in your network and/or over the internet. The clean way is to configure and run a dedicated bootnode:

$ bootnode --genkey=boot.key
$ bootnode --nodekey=boot.key

With the bootnode online, it will display an enode URL that other nodes can use to connect to it and exchange peer information. Make sure to replace the displayed IP address information (most probably [::]) with your externally accessible IP to get the actual enode URL.

Note: You could also use a full-fledged geth node as a bootnode, but it's the less recommended way.

Starting up your member nodes

With the bootnode operational and externally reachable (you can try telnet <ip> <port> to ensure it's indeed reachable), start every subsequent geth node pointed to the bootnode for peer discovery via the --bootnodes flag. It will probably also be desirable to keep the data directory of your private network separated, so do also specify a custom --datadir flag.

$ geth --datadir=path/to/custom/data/folder --bootnodes=<bootnode-enode-url-from-above>

Note: Since your network will be completely cut off from the main and test networks, you'll also need to configure a miner to process transactions and create new blocks for you.

Running a private miner

In a private network setting a single CPU miner instance is more than enough for practical purposes as it can produce a stable stream of blocks at the correct intervals without needing heavy resources (consider running on a single thread, no need for multiple ones either). To start a geth instance for mining, run it with all your usual flags, extended by:

$ geth <usual-flags> --mine --miner.threads=1 --miner.etherbase=0x0000000000000000000000000000000000000000

Which will start mining blocks and transactions on a single CPU thread, crediting all proceedings to the account specified by --miner.etherbase. You can further tune the mining by changing the default gas limit blocks converge to (--miner.targetgaslimit) and the price transactions are accepted at (--miner.gasprice).

Contribution

Thank you for considering helping out with the source code! We welcome contributions from anyone on the internet, and are grateful for even the smallest of fixes!

If you'd like to contribute to go-ethereum, please fork, fix, commit and send a pull request for the maintainers to review and merge into the main code base. If you wish to submit more complex changes though, please check up with the core devs first on our Discord Server to ensure those changes are in line with the general philosophy of the project and/or get some early feedback which can make both your efforts much lighter as well as our review and merge procedures quick and simple.

Please make sure your contributions adhere to our coding guidelines:

  • Code must adhere to the official Go formatting guidelines (i.e. uses gofmt).
  • Code must be documented adhering to the official Go commentary guidelines.
  • Pull requests need to be based on and opened against the master branch.
  • Commit messages should be prefixed with the package(s) they modify.
    • E.g. "eth, rpc: make trace configs optional"

Please see the Developers' Guide for more details on configuring your environment, managing project dependencies, and testing procedures.

Contributing to geth.ethereum.org

For contributions to the go-ethereum website, please checkout and raise pull requests against the website branch. For more detailed instructions please see the website branch README or the contributing page of the website.

License

The go-ethereum library (i.e. all code outside of the cmd directory) is licensed under the GNU Lesser General Public License v3.0, also included in our repository in the COPYING.LESSER file.

The go-ethereum binaries (i.e. all code inside of the cmd directory) are licensed under the GNU General Public License v3.0, also included in our repository in the COPYING file.

go-ethereum's People

Contributors

aaronbuchwald avatar acud avatar arachnid avatar cjentzsch avatar cubedro avatar debris avatar fjl avatar gavofyork avatar gballet avatar gluk256 avatar holiman avatar holisticode avatar janos avatar jsvisa avatar karalabe avatar lightclient avatar ligi avatar mariusvanderwijden avatar nolash avatar nonsense avatar obscuren avatar renaynay avatar rjl493456442 avatar s1na avatar s7v7nislands avatar tgerring avatar ucwong avatar vbuterin avatar zelig avatar zsfelfoldi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

go-ethereum's Issues

kaustinen: produced blocks have state root 0

No transactions occur after the conversion in the test script, but the converted tree isn't empty so it should never be 0.

I also noticed that the transition itself is started twice, and the 2nd does not seem to have an "end verkle" message, and it is associated to an empty tree.

post-genesis transition verkle branch fails to join after transition

I have been able to join a testnet transitioning at genesis if the node joins before the transition. Otherwise, it will trigger the transition at genesis and fail to join the testnet.

This has to be caused by the current timestamp being passed instead of the genesis block timestamp, but since this image is only for a testnet whose sole purpose is to demonstrate the overlay method, it's not a show stopper until the PR is merged back into kaustinen-with-shapella.

Move replay actions to the sepolia branch

The branch that is currently used for replays is outdated, and therefore a maintenance nightmare. I have started using a branch stemming off sepolia-shadow-fork as they have similar code. For this to be completed, the following needs to happen:

  • Fix replay bug at 230090
  • Grab all of Ignacio's changes and port them as well

kaustinen: genesis-time verkle transition is broken

This is something that is most definitely also broken in the rebased beverly hills. This is an analysis of the bug, it will not be fixed for now as kaustinen will do the transition on block 1 anyway.

The code has been changed so that SetupGenesisBlockWithOverride will try to load the genesis from the db. If it finds one, it will check for its state, no longer using state.New but a MPT-specific function called HasLegacyNode: https://github.com/gballet/go-ethereum/blob/kaustinen-with-shapella/core/genesis.go#L345

If this function returns false (and it will as the verkle root at genesis is not a legacy node since it uses its own storage format, it will override the genesis to be DefaultGenesisBlock.

As a result, it will complain that the genesis hashes differ.

This will not be fixed before we use the state provider, as it would take a lot of time and will be obsolete soon.

t8n: add Osaka fork

Add support for Osaka in test forks configuration here.

Probably it will make sense once we rebase this gballet/go-ethereum fork to the main repo that has all Prague stuff set up.

For now the tests in execution-spec-tests test-vectors for Verkle will say they correspond as a fork. Whenever we fix this, we can moved them to Prague.

This isn't urgent nor is blocking test vectors, just a reminder to do this change here and bubble it up there.

eip2935 system contract creation account header is missing from witness

When the system contract is first written to, the contract will be created. Because eip 158 is disabled, 0s will be written to the account header. This means that these leafs should be added to the witness the first time.

This won't be fixed for the current testnet, but it should be fixed for the next relaunch.

shower thought: remove right/left padding when it makes sense

When a value is 0, 32 bytes worth of 0s are stored. This is very wasteful and could be improved by adding a special encoding to strip them out if it's worth it.

It needs to be assessed at serialization time if using e.g. rlp or rle saves space by counting zeros while serializing the leaves, and then choosing the methods: if there are more zeros than leaves, it's worth using rle.

Dual block replay during conversion moves incorrect number of leaves

Because the CurrentAccountAddress variable is unique, and stored in the statedb, if for whatever reason a block at a given height is re-executed, there will be an issue because the head will have moved. This will produce an incorrect converted hash.

In order to do this, the value of the iterator at a given block has to be stored and recoverable.

Evaluated and plain versions of the slot tree key computation function give different results

The evaluated and plain versions of the slot tree key computation function give different results.

That is, the output of GetTreeKeyStorageSlot gives a different result than doing EvaluateAddressPoint first, and then use it to compute the slot key in GetTreeKeyStorageSlotWithEvaluatedAddress. This could come from how the parameters to the first function were calculated. Since other clients find the same value, the plain version is probably the wrong one, but it might be that everyone "fixed" their code when they saw it gave a different result from what geth was giving.

Shower thought: keep storing the contract code outside the tree

Rationale

In geth, the code is currently stored outside the tree. Reading from the tree will take time, and until this happens, code will be stored twice. Since code can no longer be written to after the first time, it makes sense to just encode code groups as their commitment and add them to the witness from the whole code read from the db.

kaustinen: reorg through the transition is broken

This has been found while trying to sync an already-converted network: the syncing node creates its own block, which is at a timestamp > pragueTime, so it performs the transition. Then the CL starts, finds the rest of the network, and sends an FCU that triggers a reorg. But since the started value is already active in the StateDB, it will try to produce a block in verkle mode, when it should not, and the root mismatch error will be shown.

Reactivate conversion test in kaustinen-with-shapella

There used to be a test in transition-post-genesis that had to be removed when merging into kaustinen-with-shapella as a lot of traces were removed.

name: Overlay conversion

on:
  push:
    branches: [ master, transition-post-genesis, store-transition-state-in-db ]
  pull_request:
    branches: [ master, kaustinen-with-shapella, transition-post-genesis, store-transition-state-in-db, lock-overlay-transition  ]
  workflow_dispatch:

jobs:
  build:
    runs-on: self-hosted
    steps:
      - uses: actions/checkout@v2
      - name: Set up Go
        uses: actions/setup-go@v2
        with:
          go-version: 1.21.1

      - name: Cleanup from previous runs
        run: |
          rm -f log.txt
          rm -rf .shadowfork
          rm -f genesis.json
      - name: Download genesis file
        run: wget https://gist.githubusercontent.com/gballet/0b02a025428aa0e7b67941864d54716c/raw/bfb4e158bca5217b356a19b2ec55c4a45a7b2bad/genesis.json

      - name: Init data
        run: go run ./cmd/geth --dev --cache.preimages init genesis.json

      - name: Run geth in devmode
        run: go run ./cmd/geth --dev --dev.period=5 --cache.preimages --http --datadir=.shadowfork --override.overlay-stride=10 --override.prague=$(($(date +%s) + 45)) > log.txt &

      - name: Wait for the transition to start
        run: |
          start_time=$(date +%s)
          while true; do
            sleep 5
            current_time=$(date +%s)
            elapsed_time=$((current_time - start_time))
            # 2 minute timeout
            if [ $elapsed_time -ge 120 ]; then
              kill -9 $(pgrep -f geth)
              exit 1
            fi
            # Check for signs that the conversion has started
            if grep -q "Processing verkle conversion starting at" log.txt; then
              break
            fi
          done
      - name: Wait for the transition to end
        run: |
          start_time=$(date +%s)
          while true; do
            sleep 5
            current_time=$(date +%s)
            elapsed_time=$((current_time - start_time))
            # 10 minute timeout
            if [ $elapsed_time -ge 300 ]; then
              cat log.txt
              kill -9 $(pgrep -f geth)
              exit 1
            fi
            # Check for signs that the conversion has started
            if egrep -q "at block.*performing transition\? false" log.txt; then
              kill -9 $(pgrep -f geth)
              break
            fi
          done

It needs to be reactivated using the new debug RPC

stacktrace in tests

In order to activate verkle mode in geth init, I forcefully set Verkle: true in the trie db config. This breaks tests that rely on geth init but are not meant to be in verkle mode. Use the content of the json file instead.

shower thought: store the top of the tree as a single node

in the new path-based storage model, we have a series of layers, to represent updates to the tree. the top layer will always be updated, so it makes sense to store all of it in a single field and save many key, values and therefore many writes. only write about 8kb of data... or don't even store it into the db.

cache stems in case multiple values are used

In order to reduce the amount of double computations, one should cache stems when they are computed. This way, they can be reused:

  • when writing two slots in the same group when updating the tree
  • for any write/read that has to happen before the final tree update at the end (FILL_COST?)
  • for the prefetcher later on

This might not be as interesting as computing stems in one swoop but it's worth checking if it positively impacts performance.

Replay: allow resume

We'd like to be able to resume a replay run, since it can be helpful for debugging if at some point of the replay there's problem so to avoid having to run from scratch.

The solution should be able to stop/resume before, during and after the state conversion happens.

An original attempt was done in #233 but that PR is closed since after another style of state transition pointers persistence was implemented.

Don't store proofs in EL blocks

This is a tracker issue for a potential improvement.

Storing proofs in blocks is redundant as they have to be stored in CL blocks. Furthermore, they are added to the EL block, but are not part of the hash. It makes sense not to store them in the EL block, and pass it to the ExecutionPayload via an interface change.

*CALL: witness costs charged AFTER EIP-150 1/64th gas subtraction

On devnet 6, the witness costs are charged once the 1/64th gas has been subtracted from the available pool. this is not correct:

  1. semantically, these costs belong to the *CALL instruction proper
  2. the total amount of gas available for the execution of the subcall is lower

debug_TraceTransaction does not work

This issue is meant to gather the current state of my investigation into this bug, which is blocking blockscout and other applications from working.

The issue is triggered by the fact that a StateDB is created (from stateAtTransaction/stateAtBlock) which doesn't load the conversion status (e.g. if the conversion has started or ended). As a result, it tries to read data from an empty tree and complains about a 0 nonce.

It should be easy to fix once the conversion status is saved in the database and #316 is fixed, since this might be a similar problem. The fix would be to ensure that LoadTransitionStatus is called from state.New and is initialized from the database.

Refactor snapshot to handle both verkle and mpt simultaneously

Shadow forks larger than 128 blocks will fail, because the snapshot and base tree are lost after 128 blocks. This means that the base MPT can not be read, and that the snapshot - necessary for the transition - is also unavailable.

There are several ways to proceed:

  1. Iterate the MPT during the conversion. This is doable in PBSS, but a bit slow.
  2. Keep more layers in RAM. This is a hack that works well, but is not going to work for mainnet.
  3. Make the snapshot support pre- and post-fork values + activate the archive node during the transition, so that the MPT can be found, and the old view of the snapshot can be iterated during the conversion.

#3 is the only sustainable approach, but it requires more thinking and it probably makes sense to only use it after the rebase.

kaustinen: syncing node doesn't go through the transition

Unlike the previous issue described in #271 , starting the syncing node before the transition manages to sync the network, but at the transition time, the elephant banner doesn't seem to work and the error message shows:

########## BAD BLOCK #########
Block: 8 (0x46e9ed87025685d26344c8d00805a89356a873cb6a6b39cde4a0258f92ebeefa)
Error: invalid merkle root (remote: 0000000000000000000000000000000000000000000000000000000000000000 local: 25acafa84c55ba32e8ac837fd7de8eb1d6712fcd9927151dc14352a058af36e2) dberr: %!w(<nil>)
Platform: geth (devel) go1.19.4 amd64 linux
VCS: 26ffffc5-20230912 (dirty)
Chain config: &params.ChainConfig{ChainID:69420, HomesteadBlock:0, DAOForkBlock:0, DAOForkSupport:false, EIP150Block:0, EIP155Block:0, EIP158Block:0, ByzantiumBlock:0, ConstantinopleBlock:0, PetersburgBlock:0, IstanbulBlock:0, MuirGlacierBlock:0, BerlinBlock:0, LondonBlock:0, ArrowGlacierBlock:<nil>, GrayGlacierBlock:<nil>, MergeNetsplitBlock:0, ShanghaiTime:(*uint64)(0xc000674bf8), CancunTime:(*uint64)(nil), PragueTime:(*uint64)(0xc000674c00), TerminalTotalDifficulty:0, TerminalTotalDifficultyPassed:true, Ethash:(*params.EthashConfig)(nil), Clique:(*params.CliqueConfig)(nil), IsDevMode:false}
Receipts:
##############################

It does seem that the original root is 0, which is a bug in itself. But the syncing node should go through the transition nonetheless.

Error decoding/generating precomp file in latest branch

This happens in cache-point-in-access-witness after merging #184.

Using a precomp file from master, it will cause the following stack trace. The same stack trace will happen when starting with a missing file.

--- FAIL: TestReproduceTree (0.07s)
panic: runtime error: makeslice: len out of range [recovered]
	panic: runtime error: makeslice: len out of range

goroutine 76409 [running]:
testing.tRunner.func1.2({0x6616a0, 0x708f40})
	/usr/local/go/src/testing/testing.go:1526 +0x24e
testing.tRunner.func1()
	/usr/local/go/src/testing/testing.go:1529 +0x39f
panic({0x6616a0, 0x708f40})
	/usr/local/go/src/runtime/panic.go:884 +0x213
github.com/crate-crypto/go-ipa/banderwagon.(*LagrangeTablePoints).Deserialize(0xc0002f2060, {0x7096e0, 0xc000702000})
	/home/gballet/go/pkg/mod/github.com/crate-crypto/[email protected]/banderwagon/precomp_multiexp.go:258 +0x19d
github.com/crate-crypto/go-ipa/banderwagon.DeserializePrecomputedLagrange({0x7096e0, 0xc000702000})
	/home/gballet/go/pkg/mod/github.com/crate-crypto/[email protected]/banderwagon/precomp_multiexp.go:152 +0x1c5
github.com/crate-crypto/go-ipa/ipa.DeserializeSRSPrecomp({0xc004e70000, 0x7f84018, 0x7f84019})
	/home/gballet/go/pkg/mod/github.com/crate-crypto/[email protected]/ipa/srs_precomp.go:73 +0x1a6
github.com/gballet/go-verkle.GetConfig()
	/home/gballet/go/pkg/mod/github.com/gballet/[email protected]/config_ipa.go:61 +0x95
github.com/gballet/go-verkle.NewLeafNode({0xc0003cce00, 0x1f?, 0x40}, {0xc000647800, 0x100, 0x100})
	/home/gballet/go/pkg/mod/github.com/gballet/[email protected]/tree.go:218 +0x1dc
github.com/gballet/go-verkle.(*InternalNode).InsertStem(0xc0006af800, {0xc0003cce00, 0x1f, 0x40}, {0xc000647800, 0x100, 0x100}, 0x0)
	/home/gballet/go/pkg/mod/github.com/gballet/[email protected]/tree.go:291 +0x11e
github.com/gballet/go-verkle.(*InternalNode).Insert(0x6acc84?, {0xc0003cce00, 0x20, 0x40}, {0xc0003cd1c0, 0x20, 0x40}, 0x41c591?)
	/home/gballet/go/pkg/mod/github.com/gballet/[email protected]/tree.go:282 +0xdc
github.com/ethereum/go-ethereum/trie.TestReproduceTree(0xc0003c4820)
	/home/gballet/src/go-ethereum/trie/verkle_test.go:71 +0xd4b
testing.tRunner(0xc0003c4820, 0x6c5ac0)
	/usr/local/go/src/testing/testing.go:1576 +0x10b
created by testing.(*T).Run
	/usr/local/go/src/testing/testing.go:1629 +0x3ea
FAIL	github.com/ethereum/go-ethereum/trie	46.549s
FAIL

Command to reproduce:

$ go test ./trie

beverly hills: proof verification issue at block #414

The created proof at block #414 does not verify. This is due to the tree not being rebuilt correctly.

An early investigation showed that this is the tree that the pre-state was proven against:

"digraph D {\ninternal [label=\"I: 6bc456a7ec1fc68d9670b0141cd4cac20d71e398875ab44f6ec7acd8c55dfb01\"]\nhash00 [label=\"H: 6b530fb455003672a21f7db01b0a34a6cde1ff3caa72add140bfa1c3f68275ea\"]\ninternal -> hash00\nhash03 [label=\"H: 16fb5e0d12682bdf7f588c30bbc9ae13bb88626b28e3f1394ae08bec50c12004\"]\ninternal -> hash03\nhash04 [label=\"H: 6e3605c9ef848c12a66b42d8683139af3c3c8cd73f9f657dd8ff607ade291022\"]\ninternal -> hash04\nhash07 [label=\"H: 0112effcfb2e5ad37684c72214be26a3b8627d2c42cbfc2ccb6504e8af7c8541\"]\ninternal -> hash07\nhash08 [label=\"H: 2c3636c7f5b143e0c4bcf39eb5390d58302c067d7e09b2e59a8cbc4ac8404ecb\"]\ninternal -> hash08\nhash09 [label=\"H: 1d85b2867e926e2c6e3f2be7b2307889f65df0fecb0a864bbffda0f6b2b1dd27\"]\ninternal -> hash09\nhash0a [label=\"H: 0313c179a0400d45f68d94bf3169b8f046f61c795c4fa3bf09af7dcdc5c9dbed\"]\ninternal -> hash0a\nhash0b [label=\"H: 37468d66e260cc9438267c016355b4d1d588d6b858bb5322b1149ee4b773af53\"]\ninternal -> hash0b\nhash0d [label=\"H: 4defdaa0f44aaa726c9a9148242a30b800c3e7a103c2bb33610fffc408bdeac4\"]\ninternal -> hash0d\nhash10 [label=\"H: 510570cc0a1d2a275671371564abc991bbd2eb1241e4273fac901f663fe79536\"]\ninternal -> hash10\nhash11 [label=\"H: 3514e85936b1e484f84fc93b58e38b9ed9b0d870002653085f9dd758b1b8c3f5\"]\ninternal -> hash11\nhash12 [label=\"H: 57d82c34a4ab8a92998a096cc1a73dbd28f368ddf9f3ad9c1b3ce5b8d3b9de03\"]\ninternal -> hash12\nhash13 [label=\"H: 4752631b727528ee8492cb367a9dd71db8aba69d5c2a0291d7a34da03ce5f65c\"]\ninternal -> hash13\nhash16 [label=\"H: 6a8ebb9a197b6b21d0eae14f7b780749df18fd30ea8be38362995d7d03870cdb\"]\ninternal -> hash16\nhash18 [label=\"H: 4f1329b4e67f081452bc3086ad96662bd59077a32c54ac730e3a28b1eda44a10\"]\ninternal -> hash18\nhash1b [label=\"H: 6cd88a0a7d236fa18b122b5a2f013a27c2701a42035dec3ae7746389fdc6b0b7\"]\ninternal -> hash1b\nhash1d [label=\"H: 1dd02b1f8d367da84c47a8ecd356a7e3855512f4f670ba0d49b76e534adad42d\"]\ninternal -> hash1d\nhash1e [label=\"H: 661a2869dc56d969162fe4a32967de758710001a61a98e2794dad772f701f103\"]\ninternal -> hash1e\nhash1f [label=\"H: 0de97ed25b47419b84d617d342d44900b7af0ede28b7a7d05b2b8bf81ea4a049\"]\ninternal -> hash1f\nhash21 [label=\"H: 2ea18fce00ea8171297c3a31dd506d0a4ca86809d5edabd17f302d7cb94664e7\"]\ninternal -> hash21\nhash22 [label=\"H: 3ae7f872ab8b319dab7ab8defd89321e572209e39698320d7c57bb857ceab844\"]\ninternal -> hash22\nhash23 [label=\"H: 6b712b902561b52e411dd1d32903f0a2d48531f7b10a50efc122c94c480cd203\"]\ninternal -> hash23\nhash24 [label=\"H: 3607ec76b616f8f2e02959db19e353ce87c3ceb7948020b991b4600c86f30640\"]\ninternal -> hash24\nhash26 [label=\"H: 483fdf6fb43dd495d56fa467151682b7d483e5e16238a4fa3c197406abdaae3c\"]\ninternal -> hash26\nhash27 [label=\"H: 447973607315d8b4e06e79ccfbf8565cdc015de6b4e3a90ab0778fe3f35f5f1e\"]\ninternal -> hash27\nhash28 [label=\"H: 15092d3e5dfb0bf93b935a238192c34db939927466c85893a469ba9f2492ac50\"]\ninternal -> hash28\nhash29 [label=\"H: 2aed522dbdf8bef22fc7633965b3e4c4568ed6491b523e8c66dd1822aa1312e4\"]\ninternal -> hash29\nhash2a [label=\"H: 4e99c2066100dad8e74c97ae2fea0e1f90f849f4984f139e4064e353396ba6c9\"]\ninternal -> hash2a\nhash2c [label=\"H: 50faa3fe6ea3a6bfd7c459654fc57c74b847a39f8ccc85b5d5bc0c835bbccdb1\"]\ninternal -> hash2c\nhash2d [label=\"H: 444a56af8daf01fb2e9bec42b100f10ec69fbc402ccbcfa5ba71ae55658015d0\"]\ninternal -> hash2d\nhash2f [label=\"H: 3216d94622109517288805f24439edea4815f8bcdd4bfe81b82373bab4127474\"]\ninternal -> hash2f\nhash30 [label=\"H: 39f5ea7419e8b0b5ffd59ea756d8aa9da9f0fbdb77b87bb49ddfea822f00a1f9\"]\ninternal -> hash30\nhash32 [label=\"H: 004080ba037ecd338f6f61e715306d71b9ea3bea1e424a138d0f6ef4f107366e\"]\ninternal -> hash32\nhash33 [label=\"H: 3e8b6c390b5076a5439824fe1f9b6fc2af652c1b65f29233f62b9beeaebaaa3f\"]\ninternal -> hash33\nhash35 [label=\"H: 3c9d60b39d60a30f2d4bd225eb4182d8d50b62dc1490d1e097ca7151ecb5934d\"]\ninternal -> hash35\nhash36 [label=\"H: 71889ddff6ed65285d9598a09be6745f4590ae86e0787a41ce58820e8c264e33\"]\ninternal -> hash36\nhash38 [label=\"H: 04458b95670abc7068172a38b9f271aceb3bd486dbb5ed01c745d47a6a5a687a\"]\ninternal -> hash38\nhash39 [label=\"H: 436af9ef47e8a561f33078a81974ac2150ba3298fdcd099a18d221b6b2add1f4\"]\ninternal -> hash39\nhash3a [label=\"H: 2ab6a659b262a14d209b30a14ca75fc5e4e12f7884f753bc761ff47a04640f96\"]\ninternal -> hash3a\nhash3c [label=\"H: 1740ffee03dce14657db88e3ad364f4cfdef9b1144cb2b7397ba4ab05ab7bb85\"]\ninternal -> hash3c\nhash3d [label=\"H: 338ce32815f7b15eefcf21297cd2d9cedd2af20a927246ec60eb2ea32af19ce6\"]\ninternal -> hash3d\nhash3e [label=\"H: 263a4dbfc622b07620571077e08079917075782746498ad6b054dfcaaba8736b\"]\ninternal -> hash3e\nhash40 [label=\"H: 6e40da399d91aa2058cf7f74ed9a3e447b31ee735e11871ccb7ba83fddf1c997\"]\ninternal -> hash40\nhash41 [label=\"H: 5738a9c10b0768f5f0923d514a252a6611f12e47365a86bdcb7bee1a71b02f53\"]\ninternal -> hash41\nhash42 [label=\"H: 682c1724c5b351d0c6b85399156308f69dc1aafb1b1aa03b61a1c8b9632ad036\"]\ninternal -> hash42\nhash43 [label=\"H: 2d26bc0804427c0382077a321968a70a384bde81b643c76542aed3d93ef096d4\"]\ninternal -> hash43\nhash45 [label=\"H: 5a90cd313f6f8e0195b6c015090e0cd3b61caa738affa74a5a53399522a8808a\"]\ninternal -> hash45\nhash47 [label=\"H: 6647bc9a5f8f843c3081bd9b0fa6068499bc7b44fe7f577275962aa92141fd2d\"]\ninternal -> hash47\nhash48 [label=\"H: 22d0f497ef6d0fa9acf70bbb62b6f56fe392276e2e7ae171ed54eec6523acec2\"]\ninternal -> hash48\nhash49 [label=\"H: 4dce0fa5ea304f586a419a71699ed4ad70c4df0454b551319a7b10a79b0c5430\"]\ninternal -> hash49\nhash4a [label=\"H: 70244fdc0c5f90d31888103574a6f6d14fa8d83f0b9ebb0b0390000056c9f179\"]\ninternal -> hash4a\nhash4d [label=\"H: 7250d80014cd4a1f11d04b6ab1e0be824302baec6607ea0dd2e199d218dc58a8\"]\ninternal -> hash4d\nhash4f [label=\"H: 56fe6e62542cc56f88d530b7fbbf349ee8051d0d6138924b9152d9097652bf85\"]\ninternal -> hash4f\nhash50 [label=\"H: 40c6e0116649f022622bbb2c435dca2ca8b32598322dea3b3f25f88af578a9dd\"]\ninternal -> hash50\nhash51 [label=\"H: 112ff51c56f8c8fcd24c615d7bed846c4f02375e5552a6999afbdb6e4be0d2d9\"]\ninternal -> hash51\nhash52 [label=\"H: 5703df2322b6765d696f2490498106f5ab48138a43779fd86d96200285cd3200\"]\ninternal -> hash52\nhash53 [label=\"H: 5788aad2dc6a6395d1850740f0cf2c566d31dddc6a1c168113a242d5d380e1ac\"]\ninternal -> hash53\nhash56 [label=\"H: 4c038af66e13f1147aab4a23440c442627d83b5a3999960a6232c8c239a02e20\"]\ninternal -> hash56\nhash58 [label=\"H: 02ec7d69bc61d61bd101c38a817da49447a80fbeae6c15ec87bef786c9f9dfd6\"]\ninternal -> hash58\nhash59 [label=\"H: 16c88f4cd4f07450fe482420509759b87b040bc384cfed59af925589c8657211\"]\ninternal -> hash59\nhash5a [label=\"H: 6c1145d495b0b6f5ca4f477803262bd525933b39fb2e5ee6bc5f2b992a10ec5a\"]\ninternal -> hash5a\nhash5b [label=\"H: 48ee700eba0ed36fa472c24ab58bf66a68513335aa7f03bad85f206d25ef8db0\"]\ninternal -> hash5b\nhash5c [label=\"H: 5215e74c1985e2b304ffca0fab7d38c686f2c03b115d771faec39d1a86edbc4f\"]\ninternal -> hash5c\nhash5d [label=\"H: 3b1ac19ba570eb5f913c61a711424d5aa988e979d28966ca639f1d8948db78d4\"]\ninternal -> hash5d\nhash5e [label=\"H: 39ea37be6839ff3ced4641ba065845dc49d899f44a55141d15fb81963e274ea1\"]\ninternal -> hash5e\nhash5f [label=\"H: 67f64548bfbf023710dbe180be401a57a715ee86c85bb78f9be3ea2b85f569f9\"]\ninternal -> hash5f\nhash60 [label=\"H: 0c21df613dc37889fcd9d0644099a7e72bb614c12e75197d7e7b2cce516789d8\"]\ninternal -> hash60\nhash61 [label=\"H: 237da44e69399898939ae111c18389adbc62d1658af16e543dd6985f1e8a68f4\"]\ninternal -> hash61\nhash63 [label=\"H: 51baedf9e0a60c331283cc8f229aee4faf002a282a833db54cf59c607f295ec6\"]\ninternal -> hash63\nhash65 [label=\"H: 0ab4ef464dc22bdee06ef25eb7100f741a8f6d842dfbac8bb9796fac953ddd7e\"]\ninternal -> hash65\nhash67 [label=\"H: 0adf0339c76b9db41550a949c9266cd4554cca0290b8c6017bc1c09d24671496\"]\ninternal -> hash67\nhash68 [label=\"H: 713a6bd9c745e455e7e8a6e22eaf96f1f1a352298241016f2866d7140efd3231\"]\ninternal -> hash68\nhash6a [label=\"H: 07cb29099fd4682b354a7b7a2bfbbc8674a2d24d2147c06835e1921159a2874c\"]\ninternal -> hash6a\nleaf6b [label=\"L: 1884bb344d6d1bbb37e1dfd7074a03da9a34f65315cbf20775c851941feb7c81\nC: 195b18574dd48ec7e7151c4a9faf8f7ef6f2d88f524365dcd5c91f69d9a4c21e\nC₁: 62dbc83963aef42b5c6696695bbbf01e92ad6d0db9e565b687bc145b463ec46c\nC₂:0000000000000000000000000000000000000000000000000000000000000000\"]\ninternal -> leaf6b\nval6b0 [label=\"0000000000000000000000000000000000000000000000000000000000000000\"]\nleaf6b -> val6b0\nval6b1 [label=\"0100000000000000000000000000000000000000000000000000000000000000\"]\nleaf6b -> val6b1\nval6b2 [label=\"0000000000000000000000000000000000000000000000000000000000000000\"]\nleaf6b -> val6b2\nval6b3 [label=\"c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470\"]\nleaf6b -> val6b3\nhash6d [label=\"H: 42e52e08e3c400b8f8760eda9039bb926cd478ef0864fe0849f3b4348e65fb5a\"]\ninternal -> hash6d\nhash6e [label=\"H: 1841878edb9d556eac10ab96d0cf07b9c4cee47ad5165142bd9ff4af43a87a53\"]\ninternal -> hash6e\nleaf70 [label=\"L: 078ec43b446e06b8e26bba392c101211b41f098ad30f76d3cf99f9293f5ae427\nC: 29827f2cc2b6e6bc66a819abc541dfe22c8b12b8af288e31ea99fbadebc17619\nC₁: 02e1f76c70af43a35236d5a95062534e76445ff350973e6939abed6eb460ca26\nC₂:0000000000000000000000000000000000000000000000000000000000000000\"]\ninternal -> leaf70\nval700 [label=\"0000000000000000000000000000000000000000000000000000000000000000\"]\nleaf70 -> val700\nval701 [label=\"0c8dccd60f8501847a5a3a030000000000000000000000000000000000000000\"]\nleaf70 -> val701\nval702 [label=\"0100000000000000000000000000000000000000000000000000000000000000\"]\nleaf70 -> val702\nval703 [label=\"c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470\"]\nleaf70 -> val703\nhash72 [label=\"H: 5cb163c082ddef8ccca693fcb7332465aac0ea0adb70bde0f4a85fe30637a652\"]\ninternal -> hash72\nhash73 [label=\"H: 5025c093a1bdd372a071ff7cb5e4325bd4bd6ff11020a2f951468ae133d831ce\"]\ninternal -> hash73\nhash75 [label=\"H: 2bb2cdb62766d53b0f395306bbdf5fa89fb5ae47691c8204b0ed81ee0f5d28c6\"]\ninternal -> hash75\nhash77 [label=\"H: 5df6ce1dcb3fa5a460fd9880bfad26c363391fc9f435df40c6d95599244a4e55\"]\ninternal -> hash77\nhash78 [label=\"H: 3da7e9efdc343410ec5b9669563be53f650cd15446f1c8a8634b0bb9feb6e23d\"]\ninternal -> hash78\nhash79 [label=\"H: 36bb4452636ef4e69f795b63676f614436f83562402828012d4a5206b752e348\"]\ninternal -> hash79\nhash7a [label=\"H: 5dbd15482c05f48bf9126df6bb1895c5ba6e3c5df352b57c885d3ac94bbb973f\"]\ninternal -> hash7a\nhash7b [label=\"H: 29e63f9fd4d7889e89989b3ec536a7fea81638520ab9416ba1116143baccb5f6\"]\ninternal -> hash7b\nhash7e [label=\"H: 0338f21ec9787a04d5b47f92985e03a6e001bfbe2bf4d5c1f4289ea7efa4f068\"]\ninternal -> hash7e\nhash7f [label=\"H: 644962a13752d3d34e3462f44b92712d5277991424db038b1004521cb8339de1\"]\ninternal -> hash7f\nhash80 [label=\"H: 1d69ef887f12801f5d35411c7038daf21cd4a9a88722106d75bffcf270874097\"]\ninternal -> hash80\nhash81 [label=\"H: 46190811e66414439797b867757687f44251c348aef4efc502da4f9d208e4ca0\"]\ninternal -> hash81\nhash83 [label=\"H: 687f66621f9816aecbc28cc6e03eb6ddee94af8043208603928f701cca8b7c9b\"]\ninternal -> hash83\nhash85 [label=\"H: 383b1a474989a79e76adb9a69f471ba52685d16ca8e63c91a0900e5a040ee03c\"]\ninternal -> hash85\nhash87 [label=\"H: 5754a03a7248d807d18003c290d8c8c607e9803310f48bcd16bbe0a231969f78\"]\ninternal -> hash87\nhash8a [label=\"H: 2f39bc8e1ff276a38dcfb96ff7d2eeae0e91e0263c187e81ae077eba765b4b89\"]\ninternal -> hash8a\nhash8d [label=\"H: 639543dba1090e083032c09b3a5f45a834b11267d0bbc719cefa7dfa74a7977e\"]\ninternal -> hash8d\nhash8e [label=\"H: 68c64c595509dc884443cba26c2a6bcf8fed0eefec968508ea6c436585ffc6d5\"]\ninternal -> hash8e\nhash90 [label=\"H: 6c5d5f7c4c499c2769a1f5678ed3948d42c0d808d6699810b10f4c3d7bcc1011\"]\ninternal -> hash90\nhash93 [label=\"H: 53c4a4bd3fb5db60a6f6b4c6075f970bacaef2dcea3b6dc9cd4107a61829dd83\"]\ninternal -> hash93\nhash94 [label=\"H: 1334eccc70ec78c896cbe5c99aa5dc90ab230bc02586512fbf7459ef54346821\"]\ninternal -> hash94\nhash95 [label=\"H: 6bbebf1a3aeaf9b2a9a3d775ecc0286c3d0e9ab293310b8985e79e016edb858e\"]\ninternal -> hash95\nhash97 [label=\"H: 59ea4fd33c082589a35344c05b4171035ee524ff9e97c80ca0b4af039ac2e923\"]\ninternal -> hash97\nhash98 [label=\"H: 62da7c65beb16d0366dbc79a10454005d7612e0facd4779a9e496e44da189d9d\"]\ninternal -> hash98\nhash99 [label=\"H: 04bd244bf3c2812a1ae158ccab5917e82d2df077e1745da0aa6d5350c591b9c5\"]\ninternal -> hash99\nhash9a [label=\"H: 68eda619b26c68309625dca78e6f08eb981bcd3850066fe722a754bdbe6753bf\"]\ninternal -> hash9a\nhash9b [label=\"H: 3ace007404c4c9634ee95d7da1ebb324e41326fb55dec678ab17d7c03f65bc78\"]\ninternal -> hash9b\nhash9c [label=\"H: 1ef6f791f272e41b479282c63bbf1aec5ca5ef17f288804fd92c296c100b056e\"]\ninternal -> hash9c\nhash9d [label=\"H: 088af9a5ae0e87a3a5d0268e627ec16293b05ebf52c17c860f4beba02e114c45\"]\ninternal -> hash9d\nhash9e [label=\"H: 09691caba7c0b6ce875252ca974e7f45f0502e31c4f0d4332945bae2494de447\"]\ninternal -> hash9e\nhasha0 [label=\"H: 26348758121fe6233e43ced1108761ac2e719cdb246cabfb46fe96cb1f4837e9\"]\ninternal -> hasha0\nhasha1 [label=\"H: 122f69de2a30f35a46310a6ed68b8d6885d36a6b9f6a615e6fd1ab04408ae27c\"]\ninternal -> hasha1\nhasha3 [label=\"H: 40ecf691e7af46ca54076a0177f5a36ceec449ae94f95344544702bc3b280558\"]\ninternal -> hasha3\nhasha5 [label=\"H: 0b5f020a89ae84eda810318ff6f0bb366aa8c512cc2185241d40e2dd813e14a6\"]\ninternal -> hasha5\nhasha6 [label=\"H: 137fd190f9574c9ab0cf8882a876dbece819821ac966796b677cb74e94f77f32\"]\ninternal -> hasha6\nhasha7 [label=\"H: 4a512be6ab9d9397c111279af8d1f9d80dc861edd1021264d8b698b1992caefd\"]\ninternal -> hasha7\nhasha9 [label=\"H: 10bf3b20d5e0e136f4e127d7e1c389959c228454ec74ac3edae7aa9caa865edc\"]\ninternal -> hasha9\nhashaa [label=\"H: 6100330d87f9567a04ca1777193c6bce366e76791dd5f1f437d47ecd3d43851a\"]\ninternal -> hashaa\nhashab [label=\"H: 25b942741f773473b961c42870024147e9072a2f3dae90bac4d6767a142d5677\"]\ninternal -> hashab\nhashac [label=\"H: 6b0d8ad92e46942ad44cd815b156a47691a87860322f86ba25966cc83e4c69c1\"]\ninternal -> hashac\nhashad [label=\"H: 66dfb34ea557b3689df31012f6d995037fb90b88b64a210d4c1d7e4a36d10e7d\"]\ninternal -> hashad\nhashaf [label=\"H: 5eb314ddbdf592cad7264b7e5015f72c311c131257da5287ae9df50029f1809d\"]\ninternal -> hashaf\nhashb0 [label=\"H: 061ae28c0758336bdf5c036b25d14ffec1f6d6e3b8fed478b7424b2d088f0c9c\"]\ninternal -> hashb0\nhashb1 [label=\"H: 668c502a96e054a267cafe3e0e0e61b6c9261d2d6f8becab2bfe701d0eb3aa2b\"]\ninternal -> hashb1\nhashb2 [label=\"H: 24659128b664d9432ebfd4262709ac4d842da92ddd72517078096ef727e96cf0\"]\ninternal -> hashb2\nhashb3 [label=\"H: 31355d0dd0066f2e40cce04d1ee6eaed274cf7c0a5d7810123a9a25ad8cf5f13\"]\ninternal -> hashb3\nhashb5 [label=\"H: 683ad1210eefa13f2944a2afa80a62b4f0a398af1f89369d0ebe8426f024a011\"]\ninternal -> hashb5\nhashb6 [label=\"H: 43bbcd464027100e4fc6bccfcdc0aacee60312b8c7cdc554b76525ccf50a936d\"]\ninternal -> hashb6\nhashb7 [label=\"H: 286b046da45480a78915ccfedacb763256d581e15c2c20beb136922057eea76d\"]\ninternal -> hashb7\nhashb8 [label=\"H: 2d67cc7d0aa32514a2f98ff2ab0b929683859e09ca82ea17746597da10bcd09f\"]\ninternal -> hashb8\nhashb9 [label=\"H: 3565edcedb57e3f65b815bfc840d40cac054bbc27619e0d4a679b4691c945607\"]\ninternal -> hashb9\nhashba [label=\"H: 4f9312133fcd9b6b80adbd952c621d849310463ff865495b0e84ff862eb68213\"]\ninternal -> hashba\nhashbb [label=\"H: 0a88f9e3dcf84067e3fd0a950fef824446c4c79e182e766f23bccd7fc03519a3\"]\ninternal -> hashbb\nhashbc [label=\"H: 49ad693fb3143cd565752634eeba317d11fb54399c682540d07adc945dda86c8\"]\ninternal -> hashbc\nhashbd [label=\"H: 10903f758daf57527b044fd2411bd5f7a9650e75469d63b94c2121b3307be97d\"]\ninternal -> hashbd\nhashbe [label=\"H: 2754fc6d0c2e55dda3b8b05d2677d5309ec88b37969b9c55d7319b3f059a4335\"]\ninternal -> hashbe\nhashbf [label=\"H: 5cf09f008c5150f33af8ffe99b847e769c625a23574f04e1a141131d81b74db2\"]\ninternal -> hashbf\nhashc1 [label=\"H: 0d7f13949dce75a72448412a79e4845a32e8b35bd6cf7a4397947e348ecc6838\"]\ninternal -> hashc1\nhashc3 [label=\"H: 2dc70bdbee0d95564476ec00b642b87e75b76332978358db2c8c847ed55192d0\"]\ninternal -> hashc3\nhashc4 [label=\"H: 6f0ce4db2a17494002de1eb8a6de9b73e279d996946947fd2a6b7607d98b31e1\"]\ninternal -> hashc4\nhashc5 [label=\"H: 092fb28187999bfcbe3ab469edf00c563d538e4952ef088340689cb11d6e863d\"]\ninternal -> hashc5\nhashc6 [label=\"H: 62fbf16f6b65be80f840091877b3f697d221b1058f37525b2263a1fc1f90a185\"]\ninternal -> hashc6\nhashc8 [label=\"H: 09b78e542e6e824f3a8d5b3fc6c18eef303ff128de296ba071ccb5b7f21c66b5\"]\ninternal -> hashc8\nhashca [label=\"H: 3a7b1d3c8c8d6f1d95dbfe26d16cf6afed1623698323f8dedfda2fd0255d2e07\"]\ninternal -> hashca\nhashcd [label=\"H: 3ddd7073518ab8564ab24049dce02f806d832b2dab7736199402e1affd28e3f3\"]\ninternal -> hashcd\nhashcf [label=\"H: 61c75058cffc8657a90611d2fd513e1ca897b4741d973507f030c231f45856c3\"]\ninternal -> hashcf\nhashd0 [label=\"H: 6a78076ffa2c3287a1946285b80c481ed46091b8b559ec2f1f012b635c88a2a3\"]\ninternal -> hashd0\nhashd2 [label=\"H: 739434163a0ac2d6950769333f7b58e0097d09f67b828646cb3c8101a3ea491a\"]\ninternal -> hashd2\nhashd3 [label=\"H: 6fc8a91c3025efc155489e7a0a99b66c0be427f6dd52b5688f24b7143b703c92\"]\ninternal -> hashd3\nhashd4 [label=\"H: 6ef1ce139176bcd2a1a45d667a60c6eb0643501e9e9fb4a04b796ad1b9ff06a2\"]\ninternal -> hashd4\nhashd5 [label=\"H: 0b3157b5ff43f32190df21b19de16c3ecc18c034b07fba3869c32878d9dfad8e\"]\ninternal -> hashd5\nhashd6 [label=\"H: 53559fc1d90f54b024303ddf8bff49f54ffd6728df9d334a3d7f741ea7551be1\"]\ninternal -> hashd6\nhashd7 [label=\"H: 6bcf3bbeaf17eec2a24a27cfe9370dc6f66c3a157a717d20f5fe65e25ea7129a\"]\ninternal -> hashd7\nhashda [label=\"H: 5d45ff7c779cd38268a726c68368b3ad399fca6c30f2e34d300d19a4791129c7\"]\ninternal -> hashda\nhashdc [label=\"H: 5faa544339d1f70497943aec93cd9588c7f7a20e22fe5f8856543c34a5021fe4\"]\ninternal -> hashdc\nhashdd [label=\"H: 2e06d38dff52e0ef0458721f225cd64d4f9453e4c3b7fb59bc63f42ad6e44bcf\"]\ninternal -> hashdd\nhashe0 [label=\"H: 3dc1d243128ec27dca18e117921179c49c854b5c6d1b05015aba3cf0776cd874\"]\ninternal -> hashe0\nhashe2 [label=\"H: 184b29b7d75e6f24021c770ae5b77561801e84c5c6bc49ca40fd7a488ba9d3ce\"]\ninternal -> hashe2\nhashe3 [label=\"H: 3badd1c3f6e16a28254e312bc3c571043b1b272b0397dbea45abd7ce65ec8eb8\"]\ninternal -> hashe3\nhashe8 [label=\"H: 22f9f5f4e2187fb2696496fc5459d76a5615b15912131090fde635b8af3b6ee8\"]\ninternal -> hashe8\nhashea [label=\"H: 0b70fc74d8c96f05225f016509c20ab1283c1168cfb36a207f95621bd9194a88\"]\ninternal -> hashea\nhasheb [label=\"H: 5b27a4d64f5a1cf6667547707245c5eec470b1a7423bbe9a2c17dac2e472cff1\"]\ninternal -> hasheb\nhashed [label=\"H: 0d1116488035c609bc0068d6b5554a94b5d9c13d32c95e16330d6ac962efa1d0\"]\ninternal -> hashed\nhashee [label=\"H: 4a3ba40ee5a67c4a102e57f9916a628c8e5f847515a4410bfb6caae442e8ccf7\"]\ninternal -> hashee\nhashef [label=\"H: 29e9b3e8cbe3a388c9bbebd9d773a66d0df3665fce658576abb8fca484f21a87\"]\ninternal -> hashef\nhashf0 [label=\"H: 1af5a0c0e544c562a876b7a6c457377bda916922a3c9d447c29b83ecc2621c58\"]\ninternal -> hashf0\nhashf1 [label=\"H: 1896ef98d17b3e1355c28f30750e8db4c62c065474be0f62ce3a467b098667ef\"]\ninternal -> hashf1\nhashf3 [label=\"H: 41152d20c5c107a9f0c6f831f149541beccb909db6ab4995907d5d8faf48b201\"]\ninternal -> hashf3\nhashf4 [label=\"H: 65902828f2aa9a1158b256d7a4c2e5ee28ba78c9ced90933fdb5578efd59ddc6\"]\ninternal -> hashf4\nhashf5 [label=\"H: 247d6ffbb9e72a308f032f7d08205a055ad2d1d9032828940d1b9e0958daa298\"]\ninternal -> hashf5\nhashf6 [label=\"H: 6dda14915ee491285a2af2f19b6d918979cb7c3b629ba8055319cbb455984cb6\"]\ninternal -> hashf6\nhashf9 [label=\"H: 56304fd558f18e9abd42a7f670bc2b81a4d47477f2327e00a3f2becd90c48136\"]\ninternal -> hashf9\nhashfc [label=\"H: 571cf2d5aa0c63060b79b46c17b73d4c1f288dcbed474c9261df9e7deb957c3c\"]\ninternal -> hashfc\nhashfd [label=\"H: 296a0e59abe82e532caef99fb79b79052f43ffe316a3bdb7e7d93b8edd143585\"]\ninternal -> hashfd\nhashfe [label=\"H: 2c94b1df7abd74f8ce8eb6edae5c484b4c1cc63c783009a7cd2ea034e28d13a3\"]\ninternal -> hashfe\nhashff [label=\"H: 42a0c560991e9acf6283dc5a217de5645a3277e9300e3380374e8d53d665600c\"]\ninternal -> hashff\n}"

This is the tree that is being rebuilt:

digraph D {\ninternal [label=\"I: 6bc456a7ec1fc68d9670b0141cd4cac20d71e398875ab44f6ec7acd8c55dfb01\"]\nleaf70 [label=\"L: 1884bb344d6d1bbb37e1dfd7074a03da9a34f65315cbf20775c851941feb7c81\nC: 195b18574dd48ec7e7151c4a9faf8f7ef6f2d88f524365dcd5c91f69d9a4c21e\nC₁: 29827f2cc2b6e6bc66a819abc541dfe22c8b12b8af288e31ea99fbadebc17619\nC₂:0000000000000000000000000000000000000000000000000000000000000000\"]\ninternal -> leaf70\nval700 [label=\"0000000000000000000000000000000000000000000000000000000000000000\"]\nleaf70 -> val700\nval701 [label=\"0c8dccd60f8501847a5a3a030000000000000000000000000000000000000000\"]\nleaf70 -> val701\nval702 [label=\"0100000000000000000000000000000000000000000000000000000000000000\"]\nleaf70 -> val702\n}
  • the C commitment for leaf 6b has been used in leaf 70
  • the commitment for leaf 70 is used as C1
  • the 0 commitment for C2 is correct, which points to the wrong commitment being picked up.
  • only 3 commitments are passed in the proof, which is consistent with only one leaf group being accessed
  • the C1 for leaf70 is passed in the proof however, but in a c2 position, which is weird?
  • still in the proof, the correct C is passed in the C1 position
  • there is a proof-of-absence stem
  • and the commitment for leaf6b's C is passed in the C position.

This point to the proof not being correctly interpreted, as the proof-of-absence stem is missing from the reconstructed tree.

witness gas consumption costs aren't always verfied

Got this while debugging the shadow fork:

panic: gas pool pushed above uint64

goroutine 4313 [running]:
github.com/ethereum/go-ethereum/core.(*GasPool).AddGas(...)
        github.com/ethereum/go-ethereum/core/gaspool.go:31
github.com/ethereum/go-ethereum/core.(*StateTransition).refundGas(0xc0247db208, 0x1778f9993fd00a15?)
        github.com/ethereum/go-ethereum/core/state_transition.go:502 +0x188
github.com/ethereum/go-ethereum/core.(*StateTransition).TransitionDb(0xc0247db208)
        github.com/ethereum/go-ethereum/core/state_transition.go:464 +0xff0
github.com/ethereum/go-ethereum/core.ApplyMessage(0x5aad1f?, 0xc0039712c0?, 0x1aa3f20?)
        github.com/ethereum/go-ethereum/core/state_transition.go:183 +0x5d
github.com/ethereum/go-ethereum/core.applyTransaction(0xc0274a2000, 0xc0005921a0, 0xc02ad9e0f8?, 0xc0007e83c0, 0xc02c8d2060, {0xaa, 0x65, 0x79, 0x9d, 0x27, ...}, ...)
        github.com/ethereum/go-ethereum/core/state_processor.go:120 +0x585
github.com/ethereum/go-ethereum/core.ApplyTransaction(0x6f6637?, {0x20afab0, 0xc000221000}, 0xc003dd9290?, 0xc003967b08?, 0x459889?, 0xc003ba5900, 0xc031f85680, 0x7f2bf1b38f18?, {{0x0, ...}, ...})
        github.com/ethereum/go-ethereum/core/state_processor.go:173 +0x2b9
github.com/ethereum/go-ethereum/miner.(*worker).commitTransaction(0xe4e3c6d5923d9969?, 0xc0139f3a00, 0xc032b13db0)
        github.com/ethereum/go-ethereum/miner/worker.go:736 +0x1d8
github.com/ethereum/go-ethereum/miner.(*worker).commitTransactions(0xc000132b40, 0xc0139f3a00, 0xc034346cc0, 0x0)
        github.com/ethereum/go-ethereum/miner/worker.go:794 +0x4d8
github.com/ethereum/go-ethereum/miner.(*worker).mainLoop(0xc000132b40)
        github.com/ethereum/go-ethereum/miner/worker.go:550 +0x96a
created by github.com/ethereum/go-ethereum/miner.newWorker
        github.com/ethereum/go-ethereum/miner/worker.go:282 +0x84a

which corresponds to a negative consumed gas. This doesn't appear when running the shadow fork with 0 witness gas costs, so that indicates that somewhere, the witness gas consumption isn't checked.

absent tx "to" address in witness when account doesn't exist

Gajinder pointed out that the following code is incorrect:

if !evm.StateDB.Exist(addr) {
		if !isPrecompile && evm.chainRules.IsEIP158 && value.Sign() == 0 {
			if evm.chainRules.IsPrague {
				// proof of absence
				tryConsumeGas(&gas, evm.Accesses.TouchAndChargeProofOfAbsence(caller.Address().Bytes()))
			}

it should be addr and not caller.Address() since it's the called address that is missing.

shower thought: don't store the code in the tree

Since it's pretty obvious that a lot of space can be saved by not storing empty leaves, it is worth trying not to store the leaves containing only code. This means:

  • In account headers, only store the account leaves and data
  • In regular code groups, only store the commitments.

This works in geth, because the code is stored out-of-band and with a better storage format.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.