diff --git a/artifacts/lee/privacy_preserving_circuit/privacy_preserving_circuit.bin b/artifacts/lee/privacy_preserving_circuit/privacy_preserving_circuit.bin index 69cfcd940..b597da53c 100644 Binary files a/artifacts/lee/privacy_preserving_circuit/privacy_preserving_circuit.bin and b/artifacts/lee/privacy_preserving_circuit/privacy_preserving_circuit.bin differ diff --git a/artifacts/lez/programs/amm.bin b/artifacts/lez/programs/amm.bin index 2fdf142e7..26ea8d026 100644 Binary files a/artifacts/lez/programs/amm.bin and b/artifacts/lez/programs/amm.bin differ diff --git a/artifacts/lez/programs/associated_token_account.bin b/artifacts/lez/programs/associated_token_account.bin index 60edcbbdc..569716588 100644 Binary files a/artifacts/lez/programs/associated_token_account.bin and b/artifacts/lez/programs/associated_token_account.bin differ diff --git a/artifacts/lez/programs/authenticated_transfer.bin b/artifacts/lez/programs/authenticated_transfer.bin index 216282765..6a73cd954 100644 Binary files a/artifacts/lez/programs/authenticated_transfer.bin and b/artifacts/lez/programs/authenticated_transfer.bin differ diff --git a/artifacts/lez/programs/bridge.bin b/artifacts/lez/programs/bridge.bin index c1b8d9884..f296dd87f 100644 Binary files a/artifacts/lez/programs/bridge.bin and b/artifacts/lez/programs/bridge.bin differ diff --git a/artifacts/lez/programs/bridge_lock.bin b/artifacts/lez/programs/bridge_lock.bin index ddadd4ed5..3962f33ea 100644 Binary files a/artifacts/lez/programs/bridge_lock.bin and b/artifacts/lez/programs/bridge_lock.bin differ diff --git a/artifacts/lez/programs/clock.bin b/artifacts/lez/programs/clock.bin index c47419be3..d07174d18 100644 Binary files a/artifacts/lez/programs/clock.bin and b/artifacts/lez/programs/clock.bin differ diff --git a/artifacts/lez/programs/cross_zone_inbox.bin b/artifacts/lez/programs/cross_zone_inbox.bin index ec1da83fa..3526df187 100644 Binary files a/artifacts/lez/programs/cross_zone_inbox.bin and b/artifacts/lez/programs/cross_zone_inbox.bin differ diff --git a/artifacts/lez/programs/cross_zone_outbox.bin b/artifacts/lez/programs/cross_zone_outbox.bin index ba3649f6b..d7543451c 100644 Binary files a/artifacts/lez/programs/cross_zone_outbox.bin and b/artifacts/lez/programs/cross_zone_outbox.bin differ diff --git a/artifacts/lez/programs/faucet.bin b/artifacts/lez/programs/faucet.bin index 399826ed6..7f2565f46 100644 Binary files a/artifacts/lez/programs/faucet.bin and b/artifacts/lez/programs/faucet.bin differ diff --git a/artifacts/lez/programs/pinata.bin b/artifacts/lez/programs/pinata.bin index febc6cd86..547b01b7c 100644 Binary files a/artifacts/lez/programs/pinata.bin and b/artifacts/lez/programs/pinata.bin differ diff --git a/artifacts/lez/programs/pinata_token.bin b/artifacts/lez/programs/pinata_token.bin index d7a6844eb..22268bc34 100644 Binary files a/artifacts/lez/programs/pinata_token.bin and b/artifacts/lez/programs/pinata_token.bin differ diff --git a/artifacts/lez/programs/ping_receiver.bin b/artifacts/lez/programs/ping_receiver.bin index dc2c06472..3cb2d0d89 100644 Binary files a/artifacts/lez/programs/ping_receiver.bin and b/artifacts/lez/programs/ping_receiver.bin differ diff --git a/artifacts/lez/programs/ping_sender.bin b/artifacts/lez/programs/ping_sender.bin index 0ae3175bd..9e4989ca0 100644 Binary files a/artifacts/lez/programs/ping_sender.bin and b/artifacts/lez/programs/ping_sender.bin differ diff --git a/artifacts/lez/programs/token.bin b/artifacts/lez/programs/token.bin index d91927d3e..11ec9a23f 100644 Binary files a/artifacts/lez/programs/token.bin and b/artifacts/lez/programs/token.bin differ diff --git a/artifacts/lez/programs/vault.bin b/artifacts/lez/programs/vault.bin index 5ce29680c..bfbdbb63a 100644 Binary files a/artifacts/lez/programs/vault.bin and b/artifacts/lez/programs/vault.bin differ diff --git a/artifacts/lez/programs/wrapped_token.bin b/artifacts/lez/programs/wrapped_token.bin index 6633ec468..a5ff4578a 100644 Binary files a/artifacts/lez/programs/wrapped_token.bin and b/artifacts/lez/programs/wrapped_token.bin differ diff --git a/lee/state_machine/core/src/account/data.rs b/lee/state_machine/core/src/account/data.rs index 867c82746..d24ccb1d0 100644 --- a/lee/state_machine/core/src/account/data.rs +++ b/lee/state_machine/core/src/account/data.rs @@ -4,14 +4,8 @@ use borsh::{BorshDeserialize, BorshSerialize}; use bytesize::ByteSize; use serde::{Deserialize, Serialize}; -/// Raised from the original 100 KiB to accommodate program elfs stored directly in -/// `Account.data` under the Program-as-Account migration. -/// -/// Observed elfs currently run 375 KB-520 KB, plus 631 KB for the fixed -/// privacy-preserving circuit itself. This value is a rough placeholder, not a considered -/// protocol constant yet — it still needs to be refined against real transaction/block-size -/// budgets (e.g. `SequencerConfig::max_block_size`, currently 1 MiB) before this is something -/// production traffic should rely on. +/// TODO: Temporarily raised cap to 700 KiB from 100 KiB. This is a placeholder +/// until multiple accounts are used to store the entire elf. pub const DATA_MAX_LENGTH: ByteSize = ByteSize::kib(700); #[derive(Debug, Default, Clone, PartialEq, Eq, Serialize, BorshSerialize)] diff --git a/lee/state_machine/core/src/program/mod.rs b/lee/state_machine/core/src/program/mod.rs index 52bb0c795..0bbbeec22 100644 --- a/lee/state_machine/core/src/program/mod.rs +++ b/lee/state_machine/core/src/program/mod.rs @@ -15,12 +15,8 @@ pub const MAX_NUMBER_CHAINED_CALLS: usize = 10; pub type ProgramId = [u32; 8]; -/// Derives the `AccountId` under which a program's data is stored, directly from its -/// `ProgramId`, by reinterpreting the 8 little-endian `u32` words as 32 raw bytes. -/// -/// A 1:1, information-preserving mapping (both types are exactly 32 bytes) rather than a -/// hash — `ProgramId` is already content-derived (RISC0's `image_id`), so no extra domain -/// separation is needed just to use it as a `HashMap` key. +/// TODO: This is a temporary conversion; will be removed once `Program` to `Account` +/// migration is complete. impl From for AccountId { fn from(program_id: ProgramId) -> Self { let bytes: Vec = program_id diff --git a/lee/state_machine/src/state/mod.rs b/lee/state_machine/src/state/mod.rs index cdce2de61..cb04e0e93 100644 --- a/lee/state_machine/src/state/mod.rs +++ b/lee/state_machine/src/state/mod.rs @@ -113,11 +113,6 @@ impl BorshDeserialize for NullifierSet { pub struct V03State { public_state: HashMap, private_state: (CommitmentSet, NullifierSet), - /// Deployed programs, stored as `Account`s keyed by `AccountId::from(program_id)` (see that - /// impl's doc comment) rather than by `ProgramId` directly, with the elf held in - /// `Account.data`. Kept as its own map rather than folded into `public_state`: nothing in - /// dispatch/execution reads or writes it, so it isn't part of the account-mutation surface - /// `program_owner`-based authorization governs — this is host-side bookkeeping only. programs: HashMap, } @@ -324,8 +319,6 @@ impl V03State { let mut accounts: Vec<(&AccountId, &Account)> = public_state.iter().collect(); accounts.sort_by(|a, b| a.0.as_ref().cmp(b.0.as_ref())); - // `programs` is `Account`-shaped now, same as `public_state` — reuse the identical - // sort-then-hash-id-plus-encoded-account pattern rather than a bespoke `ProgramId` loop. let mut program_accounts: Vec<(&AccountId, &Account)> = programs.iter().collect(); program_accounts.sort_by(|a, b| a.0.as_ref().cmp(b.0.as_ref())); diff --git a/lee/state_machine/src/validated_state_diff/mod.rs b/lee/state_machine/src/validated_state_diff/mod.rs index 276c8bcec..7ca990efd 100644 --- a/lee/state_machine/src/validated_state_diff/mod.rs +++ b/lee/state_machine/src/validated_state_diff/mod.rs @@ -112,11 +112,6 @@ impl ValidatedStateDiff { LeeError::MaxChainedCallsDepthExceeded ); - // Check that the `program_id` corresponds to a deployed program. `programs` is - // keyed by `AccountId::from(program_id)`, not `program_id` itself (see that impl's - // doc comment), and holds the elf as a plain `Account`; reconstruct a `Program` from - // it via `new_unchecked` to execute, skipping a redundant image-id recomputation - // since the id/elf pairing was already validated once, at deployment time. let Some(program_account) = state .programs() .get(&AccountId::from(chained_call.program_id)) diff --git a/lez/programs/cross_zone_inbox/core/src/lib.rs b/lez/programs/cross_zone_inbox/core/src/lib.rs index 9184e0342..4e62a1c24 100644 --- a/lez/programs/cross_zone_inbox/core/src/lib.rs +++ b/lez/programs/cross_zone_inbox/core/src/lib.rs @@ -133,13 +133,13 @@ impl SeenShard { /// Deliveries one shard can hold before it exceeds `DATA_MAX_LENGTH`. /// /// Borsh is 32 bytes of hash, a 4-byte count, then 4 bytes per index, so - /// this is exactly the 100 KiB an account may carry. + /// this is exactly the 700 KiB an account may carry. /// /// Out of reach only because of the L1 inscription cap: a block inscribes as /// one op near 1.75 MiB and a minimal emitting transaction is about 257 /// bytes, capping a peer block near 7,100 deliveries. Raising that L1 cap /// past roughly 6.3 MiB puts this back in reach. - pub const MAX_DELIVERIES: usize = 25_591; + pub const MAX_DELIVERIES: usize = 179_191; /// Decodes a shard from account data; empty data is an unclaimed shard. pub fn from_bytes(bytes: &[u8]) -> borsh::io::Result { diff --git a/test_fixtures/fixtures/prebuilt_sequencer_db.dump b/test_fixtures/fixtures/prebuilt_sequencer_db.dump index 0fe43eded..e0cc2fca2 100644 Binary files a/test_fixtures/fixtures/prebuilt_sequencer_db.dump and b/test_fixtures/fixtures/prebuilt_sequencer_db.dump differ