Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
266 changes: 110 additions & 156 deletions Cargo.lock

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions crates/base/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,22 @@ alloy-primitives.workspace = true
alloy-sol-types.workspace = true

# base: pinned to the same foundry-rs/base revision Foundry uses so the types unify.
base-common-consensus = { git = "https://github.com/foundry-rs/base", rev = "dc2c07d5438344ffe7159a50afc7a51448b8cde9", default-features = false, features = ["std"] }
base-common-eip8130 = { git = "https://github.com/foundry-rs/base", rev = "dc2c07d5438344ffe7159a50afc7a51448b8cde9", default-features = false, features = ["std"] }
base-common-genesis = { git = "https://github.com/foundry-rs/base", rev = "dc2c07d5438344ffe7159a50afc7a51448b8cde9", default-features = false, features = ["std"] }
base-common-l1-fees = { git = "https://github.com/foundry-rs/base", rev = "dc2c07d5438344ffe7159a50afc7a51448b8cde9", default-features = false, features = ["std"] }
base-common-consensus = { git = "https://github.com/foundry-rs/base", rev = "8d20ec38f386e91a56a13ff21020c6b61c3f8823", default-features = false, features = ["std"] }
base-common-base-tx = { git = "https://github.com/foundry-rs/base", rev = "8d20ec38f386e91a56a13ff21020c6b61c3f8823", default-features = false, features = ["std"] }
base-common-genesis = { git = "https://github.com/foundry-rs/base", rev = "8d20ec38f386e91a56a13ff21020c6b61c3f8823", default-features = false, features = ["std"] }
base-common-l1-fees = { git = "https://github.com/foundry-rs/base", rev = "8d20ec38f386e91a56a13ff21020c6b61c3f8823", default-features = false, features = ["std"] }

# base: the Beryl B-20 factory, token, and policy registry business logic, run through an
# evm2-backed `PrecompileStorageProvider`. These crates pull revm in, but only revm data types
# (account info, bytecode, journal checkpoints) cross the provider boundary: revm never executes.
base-common-precompiles = { git = "https://github.com/foundry-rs/base", rev = "dc2c07d5438344ffe7159a50afc7a51448b8cde9", default-features = false, features = ["std"] }
base-precompile-storage = { git = "https://github.com/foundry-rs/base", rev = "dc2c07d5438344ffe7159a50afc7a51448b8cde9", default-features = false, features = ["std"] }
base-execution-eip8130 = { git = "https://github.com/foundry-rs/base", rev = "dc2c07d5438344ffe7159a50afc7a51448b8cde9", default-features = false }
base-common-precompiles = { git = "https://github.com/foundry-rs/base", rev = "8d20ec38f386e91a56a13ff21020c6b61c3f8823", default-features = false, features = ["std"] }
base-precompile-storage = { git = "https://github.com/foundry-rs/base", rev = "8d20ec38f386e91a56a13ff21020c6b61c3f8823", default-features = false, features = ["std"] }
base-execution-base-tx = { git = "https://github.com/foundry-rs/base", rev = "8d20ec38f386e91a56a13ff21020c6b61c3f8823", default-features = false }
revm = { version = "43.0.0", default-features = false, features = ["std"] }

[dev-dependencies]
# base: the revm execution path, used as the source of truth by the differential parity tests.
base-common-chains = { git = "https://github.com/foundry-rs/base", rev = "dc2c07d5438344ffe7159a50afc7a51448b8cde9", default-features = false, features = ["std"] }
base-common-evm = { git = "https://github.com/foundry-rs/base", rev = "dc2c07d5438344ffe7159a50afc7a51448b8cde9", default-features = false, features = ["std", "optional_balance_check", "optional_fee_charge", "optional_no_base_fee"] }
base-common-chains = { git = "https://github.com/foundry-rs/base", rev = "8d20ec38f386e91a56a13ff21020c6b61c3f8823", default-features = false, features = ["std"] }
base-common-evm = { git = "https://github.com/foundry-rs/base", rev = "8d20ec38f386e91a56a13ff21020c6b61c3f8823", default-features = false, features = ["std", "optional_balance_check", "optional_fee_charge", "optional_no_base_fee"] }
k256 = { version = "0.14", features = ["ecdsa"] }
alloy-evm = { version = "0.39", default-features = false, features = ["std"] }
19 changes: 11 additions & 8 deletions crates/base/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,19 @@ are not prewarmed. The factory itself stays code-less.
## Transaction context and EIP-8130

The Cobalt transaction-context precompile (`0x8130…aa02`) reads the active precompile's `TxEnv`
for ordinary transactions, raw messages, and system calls. Zenith EIP-8130 preparation publishes
the authenticated sender, payer, and acting actor through Base's transient transaction-context
for ordinary transactions, raw messages, and system calls. Everest EIP-8130 preparation publishes
the authenticated sender and payer through Base's transient transaction-context
storage. No origin is cached across executions.

Zenith's EIP-8130 handler shares Base's authentication, account-change, nonce, and intrinsic-gas
rules. Calls execute on evm2 in atomic phases: a failed phase rolls back its writes and skips
later phases while retaining prior phases, consuming the nonce, and charging the payer. Receipts
carry one status byte per phase. Unsigned simulation skips authentication, nonce advancement,
and fees, searches a verified-feasible gas pool without exposing probes to inspectors, and
discards all state even if its caller commits the result.
The EIP-8130 handler, active from Everest, shares Base's secp256k1 authentication, delegation,
nonce, and intrinsic-gas rules. Calls carry value and pay EIP-2929
access gas for every target but the first, plus Base's new-account charge. They execute on evm2
in atomic phases: a failed phase rolls back its writes and skips later phases while retaining
prior phases, consuming the nonce, and charging the payer. Receipts carry the number of committed
phases. Under gas-limit billing, fee-charged transactions, EIP-8130 and standard alike, pay for
their whole gas limit. Unsigned simulation skips authentication and fees, searches a
verified-feasible gas pool without exposing probes to inspectors, and discards all state even if
its caller commits the result.

## Not ported yet

Expand Down
7 changes: 5 additions & 2 deletions crates/base/src/activation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

use alloy_primitives::{Address, B256, Bytes, KECCAK256_EMPTY, Log, U256, b256, keccak256};
use alloy_sol_types::{Panic, PanicKind, SolCall, SolError, SolEvent, SolInterface, sol};
use base_common_genesis::BaseUpgrade;
use base_common_genesis::{BaseFeature, BaseUpgrade};
use evm2::{
Evm, SpecId, Version,
bytecode::Bytecode,
Expand Down Expand Up @@ -375,7 +375,10 @@ pub(crate) fn run_activation_registry(
}
Err(Error::AbiDecodeFailed { selector, error }) => {
let mut bytes = selector.to_vec();
bytes.extend_from_slice(error.as_bytes());
// Cobalt compacts ABI decode failures to the selector alone.
if !upgrade.is_feature_enabled(BaseFeature::CompactAbiDecodeErrors) {
bytes.extend_from_slice(error.as_bytes());
}
Err(PrecompileError::Revert(bytes.into()))
}
};
Expand Down
Loading
Loading