-
Notifications
You must be signed in to change notification settings - Fork 63
feat: compute receipts root #111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MegaRedHand
pushed a commit
that referenced
this pull request
Jul 2, 2024
**Motivation** Replace evm code in eftests with an implementation that uses ethrex types **Description** * Implement `execute_tx` using revm * Move `evm` crate into `core` crate * Move `Transaction` into its own module * Implement multiple getters for `Transaction` fields * Implement address recovery from signed transactions * Implement conversions between ef tests types and ethrex types * Add one more ef test <!-- Link to issues: Resolves #111, Resolves #222 --> Closes #21
the value must be rlp(receipt) instead of tx_type || rlp(receipt) (if tx_type != 0)
the previous way in which the receipts trie values were computed was the right way
MegaRedHand
reviewed
Jul 2, 2024
MegaRedHand
approved these changes
Jul 3, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
unbalancedparentheses
added a commit
that referenced
this pull request
Jul 3, 2024
fmoletta
added a commit
that referenced
this pull request
Jul 11, 2024
MegaRedHand
pushed a commit
that referenced
this pull request
Jul 11, 2024
**Motivation** Add support for EIP2930 transaction **Description** Implements EIP2930Transaction + required methods & traits <!-- A clear and concise general description of the changes this PR introduces --> <!-- Link to issues: Resolves #111, Resolves #222 --> Closes None, but will enable #135 to also close #24
fmoletta
added a commit
that referenced
this pull request
Jul 12, 2024
This PR is based on #138 (as they modify the same code), please merge it first **Motivation** Add support for EIP4844 transactions <!-- Why does this pull request exist? What are its goals? --> **Description** Add `EIP4844` transactions + needed trait and methods and integrate it into existing transaction-related code <!-- A clear and concise general description of the changes this PR introduces --> <!-- Link to issues: Resolves #111, Resolves #222 --> Closes #26 (evm already performs validations before executing so adding the transaction itself will sufice)
MegaRedHand
pushed a commit
that referenced
this pull request
Jul 12, 2024
**Motivation** Add error handling to `execute_tx` and remove unwrap <!-- Why does this pull request exist? What are its goals? --> **Description** Add `EvmError` Map revm's `EVMError` to `EvmError` Add error handling to `execute_tx` <!-- A clear and concise general description of the changes this PR introduces --> <!-- Link to issues: Resolves #111, Resolves #222 --> Closes None
MegaRedHand
added a commit
that referenced
this pull request
Jul 12, 2024
**Motivation** <!-- Why does this pull request exist? What are its goals? --> **Description** <!-- A clear and concise general description of the changes this PR introduces --> <!-- Link to issues: Resolves #111, Resolves #222 --> Closes #125 --------- Co-authored-by: Tomás Grüner <[email protected]>
fmoletta
added a commit
that referenced
this pull request
Jul 16, 2024
**Motivation** Being able to store and fetch blocks from the db via `Store` api **Description** * Replace `Transaction::encode` with `Transaction::encode_with_type` logic (Reasoning: We cannot decode the transactions without knowing their type with the current behaviour, making it impossible to implement `RLPDecode` for `Transaction`) * Implement `RLPDecode` for `Transaction` (Using the logic that was previoulsy used in `EncodedTransaction::decode` (payload module)) * Implement `RLPDecode` for `Withdrawal`, `BlockHeader` and `BlockBody` * Add the folloewng methods to `Store` and `StoreEngine`: `add_block_header`, `add_block_body`, `get_block_header`, `get_block_body`, and implement them for `InMemory` and `Libmdbx` engine types <!-- A clear and concise general description of the changes this PR introduces --> <!-- Link to issues: Resolves #111, Resolves #222 --> Closes None, but is needed for #145
fmoletta
added a commit
that referenced
this pull request
Jul 16, 2024
**Motivation** Being able to serialize blocks matching the output required by the rpc spec <!-- Why does this pull request exist? What are its goals? --> **Description** *Add struct `BlockSerializable` which can be serialized to match the specifications of the rpc. It can contain either the full transactions or just their hashes. *Implement serialization for `BlockSerializable`, `BlockHeader`, `BlockBody`, `Withdrawal` and `Transaction`. Other changes: *Replace `Bloom` with `ethereum_types::Bloom` *Rename some fields in `Eip1559Transaction` to match other transaction types' fields <!-- A clear and concise general description of the changes this PR introduces --> <!-- Link to issues: Resolves #111, Resolves #222 --> Closes None, but is needed in order to implement #31
github-merge-queue bot
pushed a commit
that referenced
this pull request
May 19, 2025
**Motivation** - Fix remaining blockchain tests for Prague with LEVM. **Description** - Precompiles shouldn't be executed in case they are delegation target of the same transaction in which they are being called. - It also fixes a problem in the transfer of value in CALL. (It just moves the place where the value transfer is performed) After this there are no more `blockchain` tests we need to fix. <!-- Link to issues: Resolves #111, Resolves #222 --> Co-authored-by: @DiegoCivi
github-merge-queue bot
pushed a commit
that referenced
this pull request
May 19, 2025
…sit request error (#2832) **Motivation** Currently, when we fail to parse a deposit request we simply ignore it and keep the rest of the deposits, relying on the request hash check afterwards to notice the missing deposit request. This PR handles the error earlier and returns the appropriate `InvalidDepositRequest Error`. This will provide better debugging information and also more accurate testing via tools such as `execution-spec-tests` which rely on specific error returns. We also were not correctly validating the layout according to the [EIP](https://eips.ethereum.org/EIPS/eip-6110), as we were only checking the total size and not the size and offset of each request field <!-- Why does this pull request exist? What are its goals? --> **Description** * Check that the full layout of deposit requests is valid (aka the internal sizes and offsets of the encoded data) * Handle errors when parsing deposit requests * Check log topic matches deposit topic before parsing a request as a deposit request <!-- A clear and concise general description of the changes this PR introduces --> <!-- Link to issues: Resolves #111, Resolves #222 --> Allows us to address review comment made on execution-specs-test PR ethereum/execution-spec-tests#1607 + also closes #2132
github-merge-queue bot
pushed a commit
that referenced
this pull request
May 20, 2025
**Motivation** Support rpc endpoint `admin_peers` <!-- Why does this pull request exist? What are its goals? --> **Description** * Add rpc endpoint `admin_peers` * Track inbound connections * Store peer node version when starting a connection * Add `peer_handler: PeerHandler` field to `RpcContext` so we can access peers from the rpc * (Misc) `Syncer` & `SyncManager` now receive a `PeerHandler` upon creation instead of a `KademliaTable` * (Misc) Fix common typo across the project <!-- A clear and concise general description of the changes this PR introduces --> Data missing compared to geth implementation: * The local address of each connection * Whether a connection is trusted, static (we have no notion of this yet) <!-- Link to issues: Resolves #111, Resolves #222 --> Closes #2671
github-merge-queue bot
pushed a commit
that referenced
this pull request
May 20, 2025
**Motivation** Multiple version of the same protocol can be used when a connection is established(eth/68 and eth/69 for example). At the moment, we can only use one protocol version. <!-- Why does this pull request exist? What are its goals? --> **Description** A vec of capability is used to pass multiple versions of the protocol to some functions. The struct RLPxConnection now stores capabilities struct instead of numbers. <!-- A clear and concise general description of the changes this PR introduces --> <!-- Link to issues: Resolves #111, Resolves #222 -->
github-merge-queue bot
pushed a commit
that referenced
this pull request
May 21, 2025
**Motivation** We were excluding `ethrex-prover-bench` when doing `cargo check --workspace` because it failed when `succinct` was not instaled. **Description** - `sp1` feature was removed from the default features of `ethrex-prover-bench`. - After doing the step above, `cargo check --workspace` could be ran and some errors and warnings appeared and they were fixed. - '--exclude ethrex-prover-bench' was removed from the L1 ci job <!-- Link to issues: Resolves #111, Resolves #222 --> Closes #2807
github-merge-queue bot
pushed a commit
that referenced
this pull request
May 21, 2025
#2863) **Motivation** <!-- Why does this pull request exist? What are its goals? --> **Description** <!-- A clear and concise general description of the changes this PR introduces --> <!-- Link to issues: Resolves #111, Resolves #222 --> Closes #issue_number Co-authored-by: Tomás Arjovsky <[email protected]>
github-merge-queue bot
pushed a commit
that referenced
this pull request
May 21, 2025
**Motivation** `Block` had the hash but the `BlockHeader` didn't so they had to be passed along together. <!-- Why does this pull request exist? What are its goals? --> **Description** Move the hash into `BlockHeader`, making it accesible to it and also to `Block` <!-- A clear and concise general description of the changes this PR introduces --> <!-- Link to issues: Resolves #111, Resolves #222 --> Closes #2841
github-merge-queue bot
pushed a commit
that referenced
this pull request
May 22, 2025
…#2871) **Motivation** <!-- Why does this pull request exist? What are its goals? --> **Description** - Update blockchain tests from 4.3.0 to 4.5.0 - Update state tests from pectra-devnet-6 to 4.5.0 - Remove tests from old forks (Constantinople folder) <!-- Link to issues: Resolves #111, Resolves #222 --> Closes #issue_number
github-merge-queue bot
pushed a commit
that referenced
this pull request
May 22, 2025
**Motivation** Adds an RPC method that allows reading all transactions currently in the mempool. This endpoint was based off of Geth's `txpool_content` endpoint ([doc](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-txpool#txpool-content)) and follows the same response logic & format. As we have no notion of `queued` mempool transactions currenlty, this field will be permanently left empty The namescape and endpoint currently uses `txpool` instead of `mempool` for immediate compatibility with components compatible with geth, we should consider changing the name back to `mempool` to reflect our own types as this is not a standard endpoint and names differ between implementations. <!-- Why does this pull request exist? What are its goals? --> **Description** * Add `Mempool::content` method which returns all transactions * Add `mempool_content` rpc endpoint which returns all mempool transactions grouped by sender and indexed by nonce * (Misc) `RpcTransaction::build` now supports optional transaction index & block number <!-- A clear and concise general description of the changes this PR introduces --> <!-- Link to issues: Resolves #111, Resolves #222 --> Closes #2864
github-merge-queue bot
pushed a commit
that referenced
this pull request
May 23, 2025
**Motivation** Reduce coupling between crates ethrex_storage and ethrex_vm <!-- Why does this pull request exist? What are its goals? --> **Description** - Move `account_update.rs` from `storage` to `common/types` - Fix imports <!-- A clear and concise general description of the changes this PR introduces --> <!-- Link to issues: Resolves #111, Resolves #222 --> Closes #2852
github-merge-queue bot
pushed a commit
that referenced
this pull request
May 23, 2025
…cks in batch (#2890) **Motivation** - We don't want to implement anything for forks previous than Paris, so this can be deleted. **Description** <!-- A clear and concise general description of the changes this PR introduces --> <!-- Link to issues: Resolves #111, Resolves #222 --> Closes #issue_number
github-merge-queue bot
pushed a commit
that referenced
this pull request
May 23, 2025
**Motivation** <!-- Why does this pull request exist? What are its goals? --> - Add docs about errors in the vm because maybe it isn't completely clear which are propagated and which are not. **Description** <!-- A clear and concise general description of the changes this PR introduces --> Note: I was thinking that maybe we should be more clear with our errors struct. Maybe we should have a struct `LEVMError` that has inside 4 types of errors: `Internal`, `Database`, `TxValidation`, `EVM`. That way it's easier to understand I think. (We should also do some clearing up because it's quite messy and sometimes we don't even use the appropriate errors I've seen) <!-- Link to issues: Resolves #111, Resolves #222 --> Closes #1537 I opened [this issue](#2886) for refactoring errors because they are quite messy
github-merge-queue bot
pushed a commit
that referenced
this pull request
May 23, 2025
…ool (#2906) **Motivation** Following the `rev_comparison` levm bench tool's README to run the tool results in an error as the solidity compiler is not installed. This is not mentioned as a dependency, so this PR updates the README to mention that solidity compiler is required to use the tool and how to install it. <!-- Why does this pull request exist? What are its goals? --> **Description** * Mention solidity compiler dependency + how to install it on levm's `rev_comparison` benchmark tool README <!-- A clear and concise general description of the changes this PR introduces --> <!-- Link to issues: Resolves #111, Resolves #222 --> Closes #issue_number
mpaulucci
pushed a commit
that referenced
this pull request
May 23, 2025
…#2871) **Motivation** <!-- Why does this pull request exist? What are its goals? --> **Description** - Update blockchain tests from 4.3.0 to 4.5.0 - Update state tests from pectra-devnet-6 to 4.5.0 - Remove tests from old forks (Constantinople folder) <!-- Link to issues: Resolves #111, Resolves #222 --> Closes #issue_number
mpaulucci
pushed a commit
that referenced
this pull request
May 23, 2025
**Motivation** Adds an RPC method that allows reading all transactions currently in the mempool. This endpoint was based off of Geth's `txpool_content` endpoint ([doc](https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-txpool#txpool-content)) and follows the same response logic & format. As we have no notion of `queued` mempool transactions currenlty, this field will be permanently left empty The namescape and endpoint currently uses `txpool` instead of `mempool` for immediate compatibility with components compatible with geth, we should consider changing the name back to `mempool` to reflect our own types as this is not a standard endpoint and names differ between implementations. <!-- Why does this pull request exist? What are its goals? --> **Description** * Add `Mempool::content` method which returns all transactions * Add `mempool_content` rpc endpoint which returns all mempool transactions grouped by sender and indexed by nonce * (Misc) `RpcTransaction::build` now supports optional transaction index & block number <!-- A clear and concise general description of the changes this PR introduces --> <!-- Link to issues: Resolves #111, Resolves #222 --> Closes #2864
mpaulucci
added a commit
that referenced
this pull request
May 23, 2025
**Motivation** Reduce coupling between crates ethrex_storage and ethrex_vm <!-- Why does this pull request exist? What are its goals? --> **Description** - Move `account_update.rs` from `storage` to `common/types` - Fix imports <!-- A clear and concise general description of the changes this PR introduces --> <!-- Link to issues: Resolves #111, Resolves #222 --> Closes #2852
github-merge-queue bot
pushed a commit
that referenced
this pull request
May 23, 2025
**Motivation** <!-- Why does this pull request exist? What are its goals? --> The protocol capability offset was hardcoded within the msg code. **Description** In order to decouple the msg code from the protocol offset, a const was created with the len of the protocol. <!-- A clear and concise general description of the changes this PR introduces --> <!-- Link to issues: Resolves #111, Resolves #222 --> [geth reference](https://github.com/ethereum/go-ethereum/blob/20ad4f500e7fafab93f6d94fa171a5c0309de6ce/cmd/devp2p/internal/ethtest/protocol.go#L62) Closes #2902
github-merge-queue bot
pushed a commit
that referenced
this pull request
May 23, 2025
**Motivation** When running `make run-hive SIMULATION=...` and any of the tests failed, the hiveview would not open and we could not visualize the tests on the browser **Description** The error is ignored when running the hive simulation so the hiveview can be built and executed. <!-- Link to issues: Resolves #111, Resolves #222 -->
github-merge-queue bot
pushed a commit
that referenced
this pull request
May 26, 2025
**Motivation** Add specific error variants for system contract errors `SystemContractEmpty` & `SystemContractCallFailed`. <!-- Why does this pull request exist? What are its goals? --> **Description** * Add error variants `SystemContractEmpty` & `SystemContractCallFailed` * (Misc) minor change to error message <!-- A clear and concise general description of the changes this PR introduces --> <!-- Link to issues: Resolves #111, Resolves #222 --> Allows us to better map errors on execution-spec-tests
github-merge-queue bot
pushed a commit
that referenced
this pull request
May 27, 2025
**Motivation** - Fix holesky Prague syncing with LEVM **Description** - I previously misunderstood the behavior between [EIP 7702](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7702.md) and precompiles and because of that some edge cases were breaking our VM. The current solution I believe is implemented correctly and is also simpler than what I thought. Before we were luckily (unluckily I'd say) passing all EFTests despite this misimplementation. <!-- Link to issues: Resolves #111, Resolves #222 --> Closes #issue_number
github-merge-queue bot
pushed a commit
that referenced
this pull request
May 27, 2025
**Motivation** *Depends on #2679* The `eth` pair was not implemented in the current node record struct. Using this information allow us to discard incompatible nodes faster when trying to connect to a new peer **Description** The fork_id struct is updated every time a ENRresquest/ENRresponse msg is being received. The `eth` pair contains a single element list, which is a ForkId element. It's encoded/decoded using the default RLP procedure. The P2P TCP connections starts only when the ENR is validated. The logic of this was changed, before when a pong was received (after our ping) a new TCP connection was established. Now, the ENR pairs have to be validated in order to start a new TCP connection. When exchanging the ENRrequest/ENRresponse messages the `eth` pair is now included It can be tested starting a new node with debug level: ``` cargo run --bin ethrex -- --network test_data/genesis-kurtosis.json --log.level=debug ``` And connecting a new peer using the following command: ``` cargo run --bin ethrex -- \ --network ./test_data/genesis-kurtosis.json \ --bootnodes=$(curl -s http://localhost:8545 \ -X POST \ -H "Content-Type: application/json" \ --data '{"jsonrpc":"2.0","method":"admin_nodeInfo","params":[],"id":1}' \ | jq -r '.result.enode') \ --datadir=ethrex_c \ --authrpc.port=8553 \ --http.port=8547 \ --p2p.port=30388 \ --discovery.port=30310 ``` A debug msg can be seen once the `eth` pair is validated Also a new test has been done to test this new validation adding a node with a correct forkId and a node with an invalid forkId. For running the tests, it was needed to initialize the db so the forkId struct could be built from those values. [ETH enr entry](https://github.com/ethereum/devp2p/blob/master/enr-entries/eth.md) [EIP-2124](https://eips.ethereum.org/EIPS/eip-2124) [Ethrex Docs](https://github.com/lambdaclass/ethrex/blob/main/crates/networking/docs/Network.md) <!-- A clear and concise general description of the changes this PR introduces --> <!-- Link to issues: Resolves #111, Resolves #222 --> Closes #1799
github-merge-queue bot
pushed a commit
that referenced
this pull request
May 27, 2025
**Motivation** <!-- Why does this pull request exist? What are its goals? --> We need an automated way to make releases for the L2. **Description** <!-- A clear and concise general description of the changes this PR introduces --> Added a new Github workflow that cross-compiles the L2 components and makes a new release with the binaries. To trigger the workflow, a tag with name `l2_vX.Y.Z` has to be created. A changelog will be auto-generated based on the last tag before this one. Binaries are compiled for linux (x86-64 & arm64) and macos (arm64) <!-- Link to issues: Resolves #111, Resolves #222 -->
github-merge-queue bot
pushed a commit
that referenced
this pull request
May 27, 2025
**Motivation** <!-- Why does this pull request exist? What are its goals? --> `Ownable2Step` is safer than `Ownable`, as it requires the new owner to accept the ownership transfer. **Description** <!-- A clear and concise general description of the changes this PR introduces --> <!-- Link to issues: Resolves #111, Resolves #222 --> --------- Co-authored-by: ilitteri <[email protected]>
github-merge-queue bot
pushed a commit
that referenced
this pull request
May 29, 2025
…ng) (#2687) **Motivation** <!-- Why does this pull request exist? What are its goals? --> Refactor the Patricia Merkle Trie to avoid rehashing the affected part of the trie every time it is modified. Delay hashing until its hash is required. <!-- A clear and concise general description of the changes this PR introduces --> Replaces node hash references by either a `NodeHash` as before (for unbuffered nodes) or a node itself (for modified nodes). <!-- Link to issues: Resolves #111, Resolves #222 --> Closes #issue_number
github-merge-queue bot
pushed a commit
that referenced
this pull request
May 29, 2025
**Motivation** Ethrex is composed of several smaller projects and each of them uses a different library for secp256k1 cryptography. This is not a problem right now because the usage of some of these libraries is gated by feature flags (i.e. `l2` flag). But if we aim to reduce the amount of feature flags used across the project we will need to use a single lib to avoid future errors and name clashes. **Description** This PR removes the `libsecp256k1` crate from the workspace, in favour of the one required by `SP1` (the patched `secp25k1` crate). <!-- Link to issues: Resolves #111, Resolves #222 --> Closes #issue_number --------- Co-authored-by: Manuel Iñaki Bilbao <[email protected]>
github-merge-queue bot
pushed a commit
that referenced
this pull request
May 29, 2025
**Motivation** This aims to solve the case where a null gas tip is returned by `eth_maxPriorityFeePerGas` endpoint when the blocks used for tip estimation are empty (aka don't have transactions to obtain the tip from). Looking at Geth's implementation, I saw that for these cases [the previously calculated gas tip is used in place of the empty block's transactions' tip](https://github.com/ethereum/go-ethereum/blob/368e16f39d6c7e5cce72a92ec289adbfbaed4854/eth/gasprice/gasprice.go#L195). This PR aims to implement this logic by keeping track of the last estimated gas tip and using it in the case where gas tips are collected from the queried blocks. It also keeps track of the latest hash for which we estimated the tip so we don't need to estimate more than once for a given block. <!-- Why does this pull request exist? What are its goals? --> **Description** * Add `GasEstimator` in place of the standalone `estimate_gas_tip` so we can save and use data from previous estimations when estimating gas tips * `estimate_gas_tip` no longer returns an `Option` * Avoid estimating gas tips more than once for a single latest block * Use previously estimated gas tip when we cannot obtain gas tip values from the latest blocks (aka all queried blocks are empty of transactions) <!-- A clear and concise general description of the changes this PR introduces --> <!-- Link to issues: Resolves #111, Resolves #222 --> **Comments** The diff of `estimate_gas_tip` is not visible due to it being moved inside the impl block and its file being renamed, but the main logic was left unchanged, the only changes are at the top (using precomputed value if the tip was already estimated for that block) and at the bottom (using the previously computed value if no tips can be obtained + saving current values) Closes #2682
github-merge-queue bot
pushed a commit
that referenced
this pull request
May 30, 2025
**Motivation** <!-- Why does this pull request exist? What are its goals? --> - The goal is to return an error if there's a problem when accessing the database instead of panicking. **Description** <!-- A clear and concise general description of the changes this PR introduces --> <!-- Link to issues: Resolves #111, Resolves #222 --> Co-authored-by: Lucas Fiegl <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #106