Skip to content

Commit

Permalink
fix: constant gen (#5172)
Browse files Browse the repository at this point in the history
Not sure if this will fix the breakage.
  • Loading branch information
fcarreiro authored Mar 12, 2024
1 parent d9cbdc8 commit 394a0e0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
8 changes: 4 additions & 4 deletions l1-contracts/slither_output.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,15 +321,15 @@ src/core/messagebridge/Inbox.sol#L148-L153
Impact: Informational
Confidence: Medium
- [ ] ID-35
Variable [Constants.LOGS_HASHES_NUM_BYTES_PER_BASE_ROLLUP](src/core/libraries/ConstantsGen.sol#L131) is too similar to [Constants.NOTE_HASHES_NUM_BYTES_PER_BASE_ROLLUP](src/core/libraries/ConstantsGen.sol#L124)
Variable [Constants.LOGS_HASHES_NUM_BYTES_PER_BASE_ROLLUP](src/core/libraries/ConstantsGen.sol#L132) is too similar to [Constants.NOTE_HASHES_NUM_BYTES_PER_BASE_ROLLUP](src/core/libraries/ConstantsGen.sol#L125)

src/core/libraries/ConstantsGen.sol#L131
src/core/libraries/ConstantsGen.sol#L132


- [ ] ID-36
Variable [Constants.L1_TO_L2_MESSAGE_LENGTH](src/core/libraries/ConstantsGen.sol#L111) is too similar to [Constants.L2_TO_L1_MESSAGE_LENGTH](src/core/libraries/ConstantsGen.sol#L112)
Variable [Constants.L1_TO_L2_MESSAGE_LENGTH](src/core/libraries/ConstantsGen.sol#L112) is too similar to [Constants.L2_TO_L1_MESSAGE_LENGTH](src/core/libraries/ConstantsGen.sol#L113)

src/core/libraries/ConstantsGen.sol#L111
src/core/libraries/ConstantsGen.sol#L112


- [ ] ID-37
Expand Down
1 change: 1 addition & 0 deletions l1-contracts/src/core/libraries/ConstantsGen.sol
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ library Constants {
uint256 internal constant NUM_FIELDS_PER_SHA256 = 2;
uint256 internal constant ARGS_HASH_CHUNK_LENGTH = 32;
uint256 internal constant ARGS_HASH_CHUNK_COUNT = 32;
uint256 internal constant INITIALIZATION_SLOT_SEPARATOR = 1000_000_000;
uint256 internal constant INITIAL_L2_BLOCK_NUM = 1;
uint256 internal constant BLOB_SIZE_IN_BYTES = 126976;
uint256 internal constant MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS = 15000;
Expand Down
1 change: 1 addition & 0 deletions yarn-project/circuits.js/src/constants.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export const FUNCTION_SELECTOR_NUM_BYTES = 4;
export const NUM_FIELDS_PER_SHA256 = 2;
export const ARGS_HASH_CHUNK_LENGTH = 32;
export const ARGS_HASH_CHUNK_COUNT = 32;
export const INITIALIZATION_SLOT_SEPARATOR = 1000_000_000;
export const INITIAL_L2_BLOCK_NUM = 1;
export const BLOB_SIZE_IN_BYTES = 126976;
export const MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS = 15000;
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/circuits.js/src/scripts/constants.in.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ function parseNoirFile(fileContent: string): ParsedContent {
return;
}

const [, name, _type, value] = line.match(/global\s+(\w+)(\s*:\s*\w+)?\s*=\s*(0x[a-fA-F0-9]+|\d+);/) || [];
const [, name, _type, value] = line.match(/global\s+(\w+)(\s*:\s*\w+)?\s*=\s*(0x[a-fA-F0-9]+|[\d_]+);/) || [];
if (!name || !value) {
// eslint-disable-next-line no-console
console.warn(`Unknown content: ${line}`);
Expand Down

0 comments on commit 394a0e0

Please sign in to comment.