diff --git a/l1-contracts/slither_output.md b/l1-contracts/slither_output.md index 1017d2edd73..420d9f75330 100644 --- a/l1-contracts/slither_output.md +++ b/l1-contracts/slither_output.md @@ -32,9 +32,9 @@ src/core/libraries/HeaderLib.sol#L150 - [ ] ID-2 -[TxsDecoder.decode(bytes).vars](src/core/libraries/decoders/TxsDecoder.sol#L89) is a local variable never initialized +[TxsDecoder.decode(bytes).vars](src/core/libraries/decoders/TxsDecoder.sol#L86) is a local variable never initialized -src/core/libraries/decoders/TxsDecoder.sol#L89 +src/core/libraries/decoders/TxsDecoder.sol#L86 ## unused-return @@ -50,20 +50,27 @@ src/core/Rollup.sol#L53-L91 Impact: Medium Confidence: High - [ ] ID-4 +Dubious typecast in [TxsDecoder.read4(bytes,uint256)](src/core/libraries/decoders/TxsDecoder.sol#L359-L361): + bytes => bytes4 casting occurs in [uint256(uint32(bytes4(slice(_data,_offset,4))))](src/core/libraries/decoders/TxsDecoder.sol#L360) + +src/core/libraries/decoders/TxsDecoder.sol#L359-L361 + + + - [ ] ID-5 Dubious typecast in [MessagesDecoder.read1(bytes,uint256)](src/core/libraries/decoders/MessagesDecoder.sol#L158-L160): bytes => bytes1 casting occurs in [uint256(uint8(bytes1(_data)))](src/core/libraries/decoders/MessagesDecoder.sol#L159) src/core/libraries/decoders/MessagesDecoder.sol#L158-L160 - - [ ] ID-5 + - [ ] ID-6 Dubious typecast in [Outbox.sendL1Messages(bytes32[])](src/core/messagebridge/Outbox.sol#L38-L46): uint256 => uint32 casting occurs in [version = uint32(REGISTRY.getVersionFor(msg.sender))](src/core/messagebridge/Outbox.sol#L40) src/core/messagebridge/Outbox.sol#L38-L46 - - [ ] ID-6 + - [ ] ID-7 Dubious typecast in [Inbox.sendL2Message(DataStructures.L2Actor,uint32,bytes32,bytes32)](src/core/messagebridge/Inbox.sol#L45-L91): uint256 => uint64 casting occurs in [fee = uint64(msg.value)](src/core/messagebridge/Inbox.sol#L64) uint256 => uint32 casting occurs in [entries.insert(key,fee,uint32(_recipient.version),_deadline,_errIncompatibleEntryArguments)](src/core/messagebridge/Inbox.sol#L76) @@ -71,21 +78,21 @@ Dubious typecast in [Inbox.sendL2Message(DataStructures.L2Actor,uint32,bytes32,b src/core/messagebridge/Inbox.sol#L45-L91 - - [ ] ID-7 -Dubious typecast in [TxsDecoder.read4(bytes,uint256)](src/core/libraries/decoders/TxsDecoder.sol#L362-L364): - bytes => bytes4 casting occurs in [uint256(uint32(bytes4(slice(_data,_offset,4))))](src/core/libraries/decoders/TxsDecoder.sol#L363) + - [ ] ID-8 +Dubious typecast in [TxsDecoder.read1(bytes,uint256)](src/core/libraries/decoders/TxsDecoder.sol#L349-L351): + bytes => bytes1 casting occurs in [uint256(uint8(bytes1(slice(_data,_offset,1))))](src/core/libraries/decoders/TxsDecoder.sol#L350) -src/core/libraries/decoders/TxsDecoder.sol#L362-L364 +src/core/libraries/decoders/TxsDecoder.sol#L349-L351 - - [ ] ID-8 + - [ ] ID-9 Dubious typecast in [MessagesDecoder.read4(bytes,uint256)](src/core/libraries/decoders/MessagesDecoder.sol#L168-L170): bytes => bytes4 casting occurs in [uint256(uint32(bytes4(_data)))](src/core/libraries/decoders/MessagesDecoder.sol#L169) src/core/libraries/decoders/MessagesDecoder.sol#L168-L170 - - [ ] ID-9 + - [ ] ID-10 Dubious typecast in [HeaderLib.decode(bytes)](src/core/libraries/HeaderLib.sol#L145-L189): bytes => bytes32 casting occurs in [header.lastArchive = AppendOnlyTreeSnapshot(bytes32(_header),uint32(bytes4(_header)))](src/core/libraries/HeaderLib.sol#L153-L155) bytes => bytes4 casting occurs in [header.lastArchive = AppendOnlyTreeSnapshot(bytes32(_header),uint32(bytes4(_header)))](src/core/libraries/HeaderLib.sol#L153-L155) @@ -113,20 +120,13 @@ Dubious typecast in [HeaderLib.decode(bytes)](src/core/libraries/HeaderLib.sol#L src/core/libraries/HeaderLib.sol#L145-L189 - - [ ] ID-10 + - [ ] ID-11 Dubious typecast in [Inbox.batchConsume(bytes32[],address)](src/core/messagebridge/Inbox.sol#L122-L143): uint256 => uint32 casting occurs in [expectedVersion = uint32(REGISTRY.getVersionFor(msg.sender))](src/core/messagebridge/Inbox.sol#L128) src/core/messagebridge/Inbox.sol#L122-L143 - - [ ] ID-11 -Dubious typecast in [TxsDecoder.read1(bytes,uint256)](src/core/libraries/decoders/TxsDecoder.sol#L352-L354): - bytes => bytes1 casting occurs in [uint256(uint8(bytes1(slice(_data,_offset,1))))](src/core/libraries/decoders/TxsDecoder.sol#L353) - -src/core/libraries/decoders/TxsDecoder.sol#L352-L354 - - ## reentrancy-events Impact: Low Confidence: Medium @@ -221,13 +221,6 @@ src/core/messagebridge/Inbox.sol#L21-L231 Impact: Informational Confidence: High - [ ] ID-22 -[TxsDecoder.computeRoot(bytes32[])](src/core/libraries/decoders/TxsDecoder.sol#L294-L313) uses assembly - - [INLINE ASM](src/core/libraries/decoders/TxsDecoder.sol#L301-L303) - -src/core/libraries/decoders/TxsDecoder.sol#L294-L313 - - - - [ ] ID-23 [MessagesDecoder.decode(bytes)](src/core/libraries/decoders/MessagesDecoder.sol#L60-L150) uses assembly - [INLINE ASM](src/core/libraries/decoders/MessagesDecoder.sol#L79-L81) - [INLINE ASM](src/core/libraries/decoders/MessagesDecoder.sol#L112-L118) @@ -235,6 +228,13 @@ src/core/libraries/decoders/TxsDecoder.sol#L294-L313 src/core/libraries/decoders/MessagesDecoder.sol#L60-L150 + - [ ] ID-23 +[TxsDecoder.computeRoot(bytes32[])](src/core/libraries/decoders/TxsDecoder.sol#L291-L310) uses assembly + - [INLINE ASM](src/core/libraries/decoders/TxsDecoder.sol#L298-L300) + +src/core/libraries/decoders/TxsDecoder.sol#L291-L310 + + ## dead-code Impact: Informational Confidence: Medium diff --git a/l1-contracts/src/core/Rollup.sol b/l1-contracts/src/core/Rollup.sol index 53c1b15328f..68aa3833958 100644 --- a/l1-contracts/src/core/Rollup.sol +++ b/l1-contracts/src/core/Rollup.sol @@ -53,7 +53,7 @@ contract Rollup is IRollup { function process( bytes calldata _header, bytes32 _archive, - bytes calldata _body, // TODO(#3938) Update this to pass in only th messages and not the whole body. + bytes calldata _body, // TODO(#4492) Nuke this when updating to the new message model bytes memory _proof ) external override(IRollup) { // Decode and validate header diff --git a/l1-contracts/src/core/libraries/decoders/TxsDecoder.sol b/l1-contracts/src/core/libraries/decoders/TxsDecoder.sol index 8075daab50e..442b6a41005 100644 --- a/l1-contracts/src/core/libraries/decoders/TxsDecoder.sol +++ b/l1-contracts/src/core/libraries/decoders/TxsDecoder.sol @@ -52,11 +52,10 @@ library TxsDecoder { struct ArrayOffsets { uint256 noteHash; uint256 nullifier; - uint256 publicData; uint256 l2ToL1Msgs; + uint256 publicData; uint256 contracts; uint256 contractData; - uint256 l1ToL2Msgs; } struct Counts { @@ -71,11 +70,9 @@ library TxsDecoder { // Note: Used in `computeConsumables` to get around stack too deep errors. struct ConsumablesVars { bytes32[] baseLeaves; - bytes32[] l2ToL1Msgs; bytes baseLeaf; bytes32 encryptedLogsHash; bytes32 unencryptedLogsHash; - uint256 l1Tol2MsgsCount; } /** @@ -91,8 +88,8 @@ library TxsDecoder { { // L1 to L2 messages + // TODO(#4492): update this when implementing the new message model uint256 count = read4(_body, offset); - vars.l1Tol2MsgsCount = count; offset += 0x4 + count * 0x20; count = read4(_body, offset); // number of tx effects diff --git a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/base_or_merge_rollup_public_inputs.nr b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/base_or_merge_rollup_public_inputs.nr index 2bbaeda1a3a..3af65aac18b 100644 --- a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/base_or_merge_rollup_public_inputs.nr +++ b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/abis/base_or_merge_rollup_public_inputs.nr @@ -25,7 +25,7 @@ struct BaseOrMergeRollupPublicInputs { // U128 isn't safe if it's an input to the circuit (it won't automatically constrain the witness) // So we want to constrain it when casting these fields to U128 - // TODO(#3938): split this to txs_hash and out_hash + // TODO(#4492): update this when implementing the new message model // We hash public inputs to make them constant-sized (to then be unpacked on-chain) calldata_hash : [Field; 2], } diff --git a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/base/base_rollup_inputs.nr b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/base/base_rollup_inputs.nr index 01570f0aa9f..bb669298d4e 100644 --- a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/base/base_rollup_inputs.nr +++ b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/base/base_rollup_inputs.nr @@ -299,7 +299,6 @@ impl BaseRollupInputs { let new_contracts = combined.new_contracts; calldata_hash_inputs[offset] = new_contracts[0].contract_address.to_field(); - // TODO(#3938): make portal address 20 bytes here when updating the hashing calldata_hash_inputs[offset + 1] = new_contracts[0].portal_contract_address.to_field(); offset += MAX_NEW_CONTRACTS_PER_TX * 2; diff --git a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/root.nr b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/root.nr index 6adee65ff88..9a4c9d78466 100644 --- a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/root.nr +++ b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/root.nr @@ -71,7 +71,7 @@ impl RootRollupInputs { aggregation_object, archive, header, - // TODO(#3938): Nuke this once body hash/calldata hash is updated + // TODO(#4492): update this when implementing the new message model l1_to_l2_messages_hash: compute_messages_hash(self.new_l1_to_l2_messages) } } diff --git a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/root/root_rollup_public_inputs.nr b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/root/root_rollup_public_inputs.nr index 34a8763e739..1f9a2113afc 100644 --- a/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/root/root_rollup_public_inputs.nr +++ b/noir-projects/noir-protocol-circuits/crates/rollup-lib/src/root/root_rollup_public_inputs.nr @@ -14,6 +14,6 @@ struct RootRollupPublicInputs { // New block header header: Header, - // TODO(#3938): Nuke this once body hash/calldata hash is updated + // TODO(#4492): Nuke this once body hash/calldata hash is updated l1_to_l2_messages_hash : [Field; NUM_FIELDS_PER_SHA256], } diff --git a/yarn-project/archiver/src/archiver/kv_archiver_store/block_store.ts b/yarn-project/archiver/src/archiver/kv_archiver_store/block_store.ts index 6b1bd3c47c5..7ea9fd320a7 100644 --- a/yarn-project/archiver/src/archiver/kv_archiver_store/block_store.ts +++ b/yarn-project/archiver/src/archiver/kv_archiver_store/block_store.ts @@ -53,9 +53,6 @@ export class BlockStore { }); block.getTxs().forEach((tx, i) => { - if (tx.txHash.isZero()) { - return; - } void this.#txIndex.set(tx.txHash.toString(), [block.number, i]); }); diff --git a/yarn-project/circuit-types/src/tx_effect.ts b/yarn-project/circuit-types/src/tx_effect.ts index f5dff9d4778..c67708dee9b 100644 --- a/yarn-project/circuit-types/src/tx_effect.ts +++ b/yarn-project/circuit-types/src/tx_effect.ts @@ -115,7 +115,6 @@ export class TxEffect { publicDataUpdateRequestsBuffer, this.contractLeaves[0].toBuffer(), this.contractData[0].contractAddress.toBuffer(), - // TODO(#3938): make portal address 20 bytes here when updating the hashing this.contractData[0].portalContractAddress.toBuffer32(), encryptedLogsHashKernel0, unencryptedLogsHashKernel0, diff --git a/yarn-project/foundation/src/eth-address/index.ts b/yarn-project/foundation/src/eth-address/index.ts index 0e69bf445d8..f61c1f75b4f 100644 --- a/yarn-project/foundation/src/eth-address/index.ts +++ b/yarn-project/foundation/src/eth-address/index.ts @@ -190,7 +190,6 @@ export class EthAddress { * * @returns A 32-byte Buffer containing the padded Ethereum address. */ - // TODO(#3938): nuke this public toBuffer32() { const buffer = Buffer.alloc(32); this.buffer.copy(buffer, 12); diff --git a/yarn-project/sequencer-client/src/block_builder/solo_block_builder.ts b/yarn-project/sequencer-client/src/block_builder/solo_block_builder.ts index 0e0230791cf..6e939636be1 100644 --- a/yarn-project/sequencer-client/src/block_builder/solo_block_builder.ts +++ b/yarn-project/sequencer-client/src/block_builder/solo_block_builder.ts @@ -107,7 +107,6 @@ export class SoloBlockBuilder implements BlockBuilder { // Collect all new nullifiers, commitments, and contracts from all txs in this block const txEffects: TxEffect[] = txs.map( tx => - // TODO(#4720): Combined data should most likely contain the tx effect directly new TxEffect( tx.data.combinedData.newNoteHashes.map((c: SideEffect) => c.value) as Tuple< Fr,