Skip to content

Commit

Permalink
Merge branch 'main' into trace_block_system_call
Browse files Browse the repository at this point in the history
  • Loading branch information
stevencartavia committed Oct 27, 2024
2 parents 3ef29ef + 988c5ee commit d6a0db1
Show file tree
Hide file tree
Showing 174 changed files with 3,211 additions and 927 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/compact.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Ensures that `Compact` codec changes are backwards compatible.
#
# 1) checkout `main`
# 2) randomly generate and serialize to disk many different type vectors with `Compact` (eg. Header, Transaction, etc)
# 3) checkout `pr`
# 4) deserialize previously generated test vectors

on:

pull_request:
merge_group:
push:
branches: [main]

env:
CARGO_TERM_COLOR: always

name: compact-codec
jobs:
compact-codec:
runs-on:
group: Reth
strategy:
matrix:
bin:
- cargo run --bin reth --features "dev"
- cargo run --bin op-reth --features "optimism dev" --manifest-path crates/optimism/bin/Cargo.toml
steps:
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: Checkout base
uses: actions/checkout@v4
with:
ref: ${{ github.base_ref || 'main' }}
# On `main` branch, generates test vectors and serializes them to disk using `Compact`.
- name: Generate compact vectors
run: ${{ matrix.bin }} -- test-vectors compact --write
- name: Checkout PR
uses: actions/checkout@v4
with:
clean: false
# On incoming merge try to read and decode previously generated vectors with `Compact`
- name: Read vectors
run: ${{ matrix.bin }} -- test-vectors compact --read
61 changes: 54 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -427,12 +427,13 @@ revm-primitives = { version = "13.0.0", features = [
# eth
alloy-chains = "0.1.32"
alloy-dyn-abi = "0.8.0"
alloy-primitives = { version = "0.8.7", default-features = false }
alloy-primitives = { version = "0.8.9", default-features = false }
alloy-rlp = "0.3.4"
alloy-sol-types = "0.8.0"
alloy-trie = { version = "0.7", default-features = false }

alloy-consensus = { version = "0.5.4", default-features = false }
alloy-contract = { version = "0.5.4", default-features = false }
alloy-eips = { version = "0.5.4", default-features = false }
alloy-genesis = { version = "0.5.4", default-features = false }
alloy-json-rpc = { version = "0.5.4", default-features = false }
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ test:
pr:
make lint && \
make update-book-cli && \
cargo docs --document-private-items && \
make test

check-features:
Expand Down
9 changes: 5 additions & 4 deletions bin/reth/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub struct Cli<C: ChainSpecParser = EthereumChainSpecParser, Ext: clap::Args + f
{
/// The command to run
#[command(subcommand)]
command: Commands<C, Ext>,
pub command: Commands<C, Ext>,

/// The chain this node is running.
///
Expand All @@ -52,7 +52,7 @@ pub struct Cli<C: ChainSpecParser = EthereumChainSpecParser, Ext: clap::Args + f
value_parser = C::parser(),
global = true,
)]
chain: Arc<C::ChainSpec>,
pub chain: Arc<C::ChainSpec>,

/// Add a new instance of a node.
///
Expand All @@ -68,10 +68,11 @@ pub struct Cli<C: ChainSpecParser = EthereumChainSpecParser, Ext: clap::Args + f
/// - `HTTP_RPC_PORT`: default - `instance` + 1
/// - `WS_RPC_PORT`: default + `instance` * 2 - 2
#[arg(long, value_name = "INSTANCE", global = true, default_value_t = 1, value_parser = value_parser!(u16).range(..=200))]
instance: u16,
pub instance: u16,

/// The logging configuration for the CLI.
#[command(flatten)]
logs: LogArgs,
pub logs: LogArgs,
}

impl Cli {
Expand Down
4 changes: 2 additions & 2 deletions book/cli/reth/node.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ RPC:
--http.api <HTTP_API>
Rpc Modules to be configured for the HTTP server
[possible values: admin, debug, eth, net, trace, txpool, web3, rpc, reth, ots]
[possible values: admin, debug, eth, net, trace, txpool, web3, rpc, reth, ots, flashbots]
--http.corsdomain <HTTP_CORSDOMAIN>
Http Corsdomain to allow request from
Expand All @@ -269,7 +269,7 @@ RPC:
--ws.api <WS_API>
Rpc Modules to be configured for the WS server
[possible values: admin, debug, eth, net, trace, txpool, web3, rpc, reth, ots]
[possible values: admin, debug, eth, net, trace, txpool, web3, rpc, reth, ots, flashbots]
--ipcdisable
Disable the IPC-RPC server
Expand Down
8 changes: 4 additions & 4 deletions crates/blockchain-tree/src/blockchain_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1375,6 +1375,7 @@ where
mod tests {
use super::*;
use alloy_consensus::{TxEip1559, EMPTY_ROOT_HASH};
use alloy_eips::eip1559::INITIAL_BASE_FEE;
use alloy_genesis::{Genesis, GenesisAccount};
use alloy_primitives::{keccak256, Address, Sealable, B256};
use assert_matches::assert_matches;
Expand All @@ -1386,7 +1387,6 @@ mod tests {
use reth_evm::test_utils::MockExecutorProvider;
use reth_evm_ethereum::execute::EthExecutorProvider;
use reth_primitives::{
constants::EIP1559_INITIAL_BASE_FEE,
proofs::{calculate_receipt_root, calculate_transaction_root},
revm_primitives::AccountInfo,
Account, BlockBody, Header, Signature, Transaction, TransactionSigned,
Expand Down Expand Up @@ -1560,15 +1560,15 @@ mod tests {
provider_rw.commit().unwrap();
}

let single_tx_cost = U256::from(EIP1559_INITIAL_BASE_FEE * MIN_TRANSACTION_GAS);
let single_tx_cost = U256::from(INITIAL_BASE_FEE * MIN_TRANSACTION_GAS);
let mock_tx = |nonce: u64| -> TransactionSignedEcRecovered {
TransactionSigned::from_transaction_and_signature(
Transaction::Eip1559(TxEip1559 {
chain_id: chain_spec.chain.id(),
nonce,
gas_limit: MIN_TRANSACTION_GAS,
to: Address::ZERO.into(),
max_fee_per_gas: EIP1559_INITIAL_BASE_FEE as u128,
max_fee_per_gas: INITIAL_BASE_FEE as u128,
..Default::default()
}),
Signature::test_signature(),
Expand Down Expand Up @@ -1605,7 +1605,7 @@ mod tests {
gas_used: body.len() as u64 * MIN_TRANSACTION_GAS,
gas_limit: chain_spec.max_gas_limit,
mix_hash: B256::random(),
base_fee_per_gas: Some(EIP1559_INITIAL_BASE_FEE),
base_fee_per_gas: Some(INITIAL_BASE_FEE),
transactions_root,
receipts_root,
state_root: state_root_unhashed(HashMap::from([(
Expand Down
Loading

0 comments on commit d6a0db1

Please sign in to comment.