Skip to content

Commit

Permalink
Bump FEE_FUNDING_FOR_TESTER_ACCOUNT and move out of global constants
Browse files Browse the repository at this point in the history
  • Loading branch information
spalladino committed Nov 27, 2024
1 parent b8f4d6b commit ecad2d1
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 7 deletions.
1 change: 0 additions & 1 deletion l1-contracts/src/core/libraries/ConstantsGen.sol
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ library Constants {
uint256 internal constant GENESIS_ARCHIVE_ROOT =
1002640778211850180189505934749257244705296832326768971348723156503780793518;
uint256 internal constant FEE_JUICE_INITIAL_MINT = 200000000000000000000;
uint256 internal constant FEE_FUNDING_FOR_TESTER_ACCOUNT = 100000000000000000000;
uint256 internal constant PUBLIC_DISPATCH_SELECTOR = 3578010381;
uint256 internal constant MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS = 3000;
uint256 internal constant MAX_PACKED_BYTECODE_SIZE_PER_PRIVATE_FUNCTION_IN_FIELDS = 3000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ pub global GENESIS_ARCHIVE_ROOT: Field =
// The following and the value in `deploy_l1_contracts` must match. We should not have the code both places, but
// we are running into circular dependency issues. #3342
global FEE_JUICE_INITIAL_MINT: Field = 200000000000000000000;
global FEE_FUNDING_FOR_TESTER_ACCOUNT: Field = 100000000000000000000; // 100e18
// Last 4 bytes of the Poseidon2 hash of 'public_dispatch(Field)'.
pub global PUBLIC_DISPATCH_SELECTOR: Field = 0xd5441b0d;

Expand Down
4 changes: 2 additions & 2 deletions yarn-project/circuits.js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"./interfaces": "./dest/interfaces/index.js",
"./utils": "./dest/utils/index.js",
"./types": "./dest/types/index.js",
"./constants": "./dest/constants.gen.js",
"./constants": "./dest/constants.js",
"./contract": "./dest/contract/index.js",
"./merkle": "./dest/merkle/index.js",
"./simulation": "./dest/simulator/index.js"
Expand Down Expand Up @@ -101,4 +101,4 @@
]
]
}
}
}
1 change: 0 additions & 1 deletion yarn-project/circuits.js/src/constants.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ export const BLOB_SIZE_IN_BYTES = 126976;
export const AZTEC_MAX_EPOCH_DURATION = 32;
export const GENESIS_ARCHIVE_ROOT = 1002640778211850180189505934749257244705296832326768971348723156503780793518n;
export const FEE_JUICE_INITIAL_MINT = 200000000000000000000n;
export const FEE_FUNDING_FOR_TESTER_ACCOUNT = 100000000000000000000n;
export const PUBLIC_DISPATCH_SELECTOR = 3578010381;
export const MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS = 3000;
export const MAX_PACKED_BYTECODE_SIZE_PER_PRIVATE_FUNCTION_IN_FIELDS = 3000;
Expand Down
5 changes: 5 additions & 0 deletions yarn-project/circuits.js/src/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Typescript-land-only constants
export const FEE_FUNDING_FOR_TESTER_ACCOUNT = BigInt(1_000e18);

// Autogenerated constants loaded from noir-land
export * from './constants.gen.js';
2 changes: 1 addition & 1 deletion yarn-project/circuits.js/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export * from './constants.gen.js';
export * from './constants.js';
export * from './contract/index.js';
export * from './hints/index.js';
export * from './interfaces/index.js';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ export class GasTxValidator implements TxValidator<Tx> {

const balance = claimFunctionCall ? initialBalance.add(claimFunctionCall.args[2]) : initialBalance;
if (balance.lt(feeLimit)) {
this.#log.info(`Rejecting transaction due to not enough fee payer balance`, { feePayer, balance, feeLimit });
this.#log.info(`Rejecting transaction due to not enough fee payer balance`, {
feePayer,
balance: balance.toBigInt(),
feeLimit: feeLimit.toBigInt(),
});
return false;
}
return true;
Expand Down

0 comments on commit ecad2d1

Please sign in to comment.