Skip to content
Open
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
97 changes: 48 additions & 49 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,3 @@ eyre = "0.6"
# Allocator + heap profiling
tikv-jemallocator = { version = "0.6", features = ["stats", "unprefixed_malloc_on_supported_platforms", "profiling"] }
jemalloc_pprof = { version = "0.8", features = ["flamegraph"] }

4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ docker-build: ## 🐳 Build the Docker image
-t ghcr.io/lambdaclass/ethlambda:$(DOCKER_TAG) .
@echo

# 2026-05-21
LEAN_SPEC_COMMIT_HASH:=825bec6bf278920cfc56730d64a7c90522a0bb6c
# 2026-06-03
LEAN_SPEC_COMMIT_HASH:=30ffb6cab54ca6d2e2e1c82e8e2713ebb9a8fa3f

leanSpec:
git clone https://github.com/leanEthereum/leanSpec.git --single-branch
Expand Down
4 changes: 2 additions & 2 deletions crates/common/crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ version.workspace = true
[dependencies]
ethlambda-types.workspace = true

lean-multisig = { git = "https://github.com/leanEthereum/leanMultisig.git", rev = "0242c909" }
lean-multisig = { git = "https://github.com/leanEthereum/leanVM.git", rev = "8fcbd779" }
# leansig_wrapper provides XmssPublicKey/XmssSignature types used by lean-multisig's public API
leansig_wrapper = { git = "https://github.com/leanEthereum/leanMultisig.git", rev = "0242c909" }
leansig_wrapper = { git = "https://github.com/leanEthereum/leanVM.git", rev = "8fcbd779" }

leansig.workspace = true
thiserror.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/common/crypto/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use thiserror::Error;

/// log(1/rate) for the WHIR commitment scheme used inside lean-multisig.
/// 2 matches the devnet-4 cross-client convention (zeam, ream, grandine, lantern
/// all use 2); the leanMultisig devnet5 examples also use 2 for recursion.
/// all use 2); the leanVM devnet5 examples also use 2 for recursion.
const LOG_INV_RATE: usize = 2;

// Lazy initialization for prover and verifier setup
Expand Down
4 changes: 2 additions & 2 deletions crates/common/test-fixtures/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ impl From<BlockHeader> for ethlambda_types::block::BlockHeader {
#[derive(Debug, Clone, Deserialize)]
pub struct Validator {
index: u64,
#[serde(rename = "attestationPubkey")]
#[serde(rename = "attestationPublicKey")]
#[serde(deserialize_with = "deser_pubkey_hex")]
attestation_pubkey: ValidatorPubkeyBytes,
#[serde(rename = "proposalPubkey")]
#[serde(rename = "proposalPublicKey")]
#[serde(deserialize_with = "deser_pubkey_hex")]
proposal_pubkey: ValidatorPubkeyBytes,
}
Expand Down
2 changes: 1 addition & 1 deletion crates/common/test-fixtures/src/fork_choice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ fn default_true() -> bool {

#[derive(Debug, Clone, Deserialize)]
pub struct AttestationStepData {
#[serde(rename = "validatorId")]
#[serde(rename = "validatorIndex")]
pub validator_id: Option<u64>,
pub data: AttestationData,
#[serde(default, deserialize_with = "deser_opt_xmss_hex")]
Expand Down
36 changes: 33 additions & 3 deletions crates/common/test-fixtures/src/verify_signatures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,29 @@ pub struct VerifySignaturesTest {
pub struct TestSignedBlock {
#[serde(alias = "message")]
pub block: Block,
pub proof: HexBytes,
pub proof: ProofField,
}

/// Merged Type-2 proof bytes, in either fixture shape.
///
/// leanSpec PR #799 typed `SignedBlock.proof` as a multi-signature container,
/// nesting the bytes one level deeper: `{ "proof": { "data": "0x..." } }`.
/// The flat `{ "data": "0x..." }` shape (PR #717) is still accepted since the
/// Hive test driver receives the same JSON from older spec-assets simulators.
#[derive(Debug, Clone, Deserialize)]
#[serde(untagged)]
pub enum ProofField {
Typed { proof: HexBytes },
Flat(HexBytes),
}

impl ProofField {
pub fn decode(&self) -> Result<Vec<u8>, hex::FromHexError> {
match self {
Self::Typed { proof } => proof.decode(),
Self::Flat(bytes) => bytes.decode(),
}
}
}

/// `{ "data": "0x..." }` wrapper used by leanSpec fixtures for byte fields.
Expand Down Expand Up @@ -107,14 +129,22 @@ impl From<TestSignedBlock> for SignedBlock {
impl TestSignedBlock {
/// Materialize a `SignedBlock` preserving the fixture-supplied merged
/// Type-2 proof bytes verbatim.
///
/// The typed shape carries the raw lean-multisig wire, so it gets wrapped
/// into the SSZ-container envelope `SignedBlock.proof` stores. The flat
/// shape already includes that envelope and passes through unchanged.
pub fn try_into_signed_block_with_proofs(self) -> Result<SignedBlock, SignedBlockConvertError> {
let bytes = self
.proof
.decode()
.map_err(|err| SignedBlockConvertError::InvalidProofHex(err.to_string()))?;
let len = bytes.len();
let proof = ByteList512KiB::try_from(bytes)
.map_err(|_| SignedBlockConvertError::ProofTooLarge(len))?;
let proof = match self.proof {
ProofField::Typed { .. } => SignedBlock::wrap_merged_proof(&bytes)
.map_err(|_| SignedBlockConvertError::ProofTooLarge(len))?,
ProofField::Flat(_) => ByteList512KiB::try_from(bytes)
.map_err(|_| SignedBlockConvertError::ProofTooLarge(len))?,
};
Ok(SignedBlock {
message: self.block.into(),
proof,
Expand Down
4 changes: 2 additions & 2 deletions crates/common/types/tests/ssz_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ pub fn decode_hex_h256(hex_str: &str) -> Result<H256, Box<dyn std::error::Error>

#[derive(Debug, Clone, Deserialize)]
pub struct Attestation {
#[serde(rename = "validatorId")]
#[serde(rename = "validatorIndex")]
pub validator_id: u64,
pub data: AttestationData,
}
Expand Down Expand Up @@ -107,7 +107,7 @@ where

#[derive(Debug, Clone, Deserialize)]
pub struct SignedAttestation {
#[serde(rename = "validatorId")]
#[serde(rename = "validatorIndex")]
pub validator_id: u64,
pub data: AttestationData,
#[serde(deserialize_with = "deser_signature_hex")]
Expand Down
Loading