From e8c57418c2680fd3dd24ffd711bb8707dd832986 Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Thu, 2 Jan 2025 15:45:46 -0300 Subject: [PATCH] Fix phases validator for received txs --- yarn-project/aztec-node/src/aztec-node/server.ts | 3 ++- yarn-project/end-to-end/src/fixtures/utils.ts | 3 ++- yarn-project/sequencer-client/src/index.ts | 2 +- yarn-project/sequencer-client/src/sequencer/index.ts | 1 + .../sequencer-client/src/tx_validator/phases_validator.ts | 1 + 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/yarn-project/aztec-node/src/aztec-node/server.ts b/yarn-project/aztec-node/src/aztec-node/server.ts index 82519a3752c5..833417053991 100644 --- a/yarn-project/aztec-node/src/aztec-node/server.ts +++ b/yarn-project/aztec-node/src/aztec-node/server.ts @@ -69,6 +69,7 @@ import { type L1Publisher, SequencerClient, createValidatorForAcceptingTxs, + getDefaultAllowedSetupFunctions, } from '@aztec/sequencer-client'; import { PublicProcessorFactory } from '@aztec/simulator'; import { Attributes, type TelemetryClient, type Traceable, type Tracer, trackSpan } from '@aztec/telemetry-client'; @@ -867,7 +868,7 @@ export class AztecNodeService implements AztecNode, Traceable { blockNumber, l1ChainId: this.l1ChainId, enforceFees: !!this.config.enforceFees, - setupAllowList: this.config.allowedInSetup ?? [], + setupAllowList: this.config.allowedInSetup ?? getDefaultAllowedSetupFunctions(), gasFees: await this.getCurrentBaseFees(), }); diff --git a/yarn-project/end-to-end/src/fixtures/utils.ts b/yarn-project/end-to-end/src/fixtures/utils.ts index b4c4ce04461a..4e1569adc977 100644 --- a/yarn-project/end-to-end/src/fixtures/utils.ts +++ b/yarn-project/end-to-end/src/fixtures/utils.ts @@ -52,6 +52,7 @@ import { type Anvil } from '@viem/anvil'; import fs from 'fs/promises'; import { tmpdir } from 'os'; import * as path from 'path'; +import { inspect } from 'util'; import { type Account, type Chain, @@ -683,7 +684,7 @@ export async function setupCanonicalFeeJuice(pxe: PXE) { .wait(); getLogger().info(`Fee Juice successfully setup. Portal address: ${feeJuicePortalAddress}`); } catch (error) { - getLogger().info(`Fee Juice might have already been setup.`); + getLogger().warn(`Fee Juice might have already been setup. Got error: ${inspect(error)}.`); } } diff --git a/yarn-project/sequencer-client/src/index.ts b/yarn-project/sequencer-client/src/index.ts index 813d6ebb67f1..c882ccd88761 100644 --- a/yarn-project/sequencer-client/src/index.ts +++ b/yarn-project/sequencer-client/src/index.ts @@ -2,7 +2,7 @@ export * from './client/index.js'; export * from './config.js'; export * from './publisher/index.js'; export * from './tx_validator/tx_validator_factory.js'; -export { Sequencer, SequencerState } from './sequencer/index.js'; +export { Sequencer, SequencerState, getDefaultAllowedSetupFunctions } from './sequencer/index.js'; // Used by the node to simulate public parts of transactions. Should these be moved to a shared library? // ISSUE(#9832) diff --git a/yarn-project/sequencer-client/src/sequencer/index.ts b/yarn-project/sequencer-client/src/sequencer/index.ts index 459a5cab42ff..316084b13f13 100644 --- a/yarn-project/sequencer-client/src/sequencer/index.ts +++ b/yarn-project/sequencer-client/src/sequencer/index.ts @@ -1,2 +1,3 @@ export * from './config.js'; export * from './sequencer.js'; +export * from './allowed.js'; diff --git a/yarn-project/sequencer-client/src/tx_validator/phases_validator.ts b/yarn-project/sequencer-client/src/tx_validator/phases_validator.ts index d69771491b4a..2d885f68ce6e 100644 --- a/yarn-project/sequencer-client/src/tx_validator/phases_validator.ts +++ b/yarn-project/sequencer-client/src/tx_validator/phases_validator.ts @@ -37,6 +37,7 @@ export class PhasesTxValidator implements TxValidator { `Rejecting tx ${Tx.getHash(tx)} because it calls setup function not on allow list: ${ setupFn.callContext.contractAddress }:${setupFn.callContext.functionSelector}`, + { allowList: this.setupAllowList }, ); return { result: 'invalid', reason: ['Setup function not on allow list'] };