Skip to content

Commit

Permalink
Fix phases validator for received txs
Browse files Browse the repository at this point in the history
  • Loading branch information
spalladino committed Jan 3, 2025
1 parent dfe9ed5 commit e8c5741
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion yarn-project/aztec-node/src/aztec-node/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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(),
});

Expand Down
3 changes: 2 additions & 1 deletion yarn-project/end-to-end/src/fixtures/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)}.`);
}
}

Expand Down
2 changes: 1 addition & 1 deletion yarn-project/sequencer-client/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions yarn-project/sequencer-client/src/sequencer/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from './config.js';
export * from './sequencer.js';
export * from './allowed.js';
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export class PhasesTxValidator implements TxValidator<Tx> {
`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'] };
Expand Down

0 comments on commit e8c5741

Please sign in to comment.