From 36441000ff2469c7bfce2ac15991c18ae85f6cf7 Mon Sep 17 00:00:00 2001 From: MirandaWood Date: Mon, 16 Dec 2024 16:33:03 +0000 Subject: [PATCH] chore: remove abi refs from publisher (+add issue num) --- noir-projects/Earthfile | 2 + .../noir-protocol-circuits/bootstrap.sh | 2 +- .../src/publisher/l1-publisher.ts | 43 +++---------------- 3 files changed, 8 insertions(+), 39 deletions(-) diff --git a/noir-projects/Earthfile b/noir-projects/Earthfile index 6fbbd87db9e..de730f1d212 100644 --- a/noir-projects/Earthfile +++ b/noir-projects/Earthfile @@ -105,6 +105,7 @@ test-protocol-circuits: # Install nargo COPY ../noir/+nargo/nargo /usr/bin/nargo + # TODO(#10754): Remove --skip-brillig-constraints-check RUN cd /usr/src/noir-projects/noir-protocol-circuits && nargo test --silence-warnings --skip-brillig-constraints-check test-aztec-nr: @@ -161,6 +162,7 @@ gates-report: COPY ../barretenberg/cpp/+preset-release/bin/bb /usr/src/barretenberg/cpp/build/bin/bb ENV BB_BIN /usr/src/barretenberg/cpp/build/bin/bb + # TODO(#10754): Remove --skip-brillig-constraints-check RUN cd noir-protocol-circuits && yarn && node ./scripts/generate_variants.js tiny && nargo compile --silence-warnings --skip-brillig-constraints-check COPY ./gates_report.sh ./gates_report.sh diff --git a/noir-projects/noir-protocol-circuits/bootstrap.sh b/noir-projects/noir-protocol-circuits/bootstrap.sh index 4f809893b3f..99024b5f00c 100755 --- a/noir-projects/noir-protocol-circuits/bootstrap.sh +++ b/noir-projects/noir-protocol-circuits/bootstrap.sh @@ -20,7 +20,7 @@ node ./scripts/generate_variants.js NARGO=${NARGO:-../../noir/noir-repo/target/release/nargo} echo "Compiling protocol circuits with ${RAYON_NUM_THREADS:-1} threads" -# NOTE: --skip-brillig-constraints-check added temporarily for blobs build time +# TODO(#10754): Remove --skip-brillig-constraints-check RAYON_NUM_THREADS=${RAYON_NUM_THREADS:-1} $NARGO compile --silence-warnings --skip-brillig-constraints-check BB_HASH=${BB_HASH:-$(cd ../../ && git ls-tree -r HEAD | grep 'barretenberg/cpp' | awk '{print $3}' | git hash-object --stdin)} diff --git a/yarn-project/sequencer-client/src/publisher/l1-publisher.ts b/yarn-project/sequencer-client/src/publisher/l1-publisher.ts index f2580de6a6f..565992d80c7 100644 --- a/yarn-project/sequencer-client/src/publisher/l1-publisher.ts +++ b/yarn-project/sequencer-client/src/publisher/l1-publisher.ts @@ -34,7 +34,7 @@ import { createLogger } from '@aztec/foundation/log'; import { type Tuple, serializeToBuffer } from '@aztec/foundation/serialize'; import { InterruptibleSleep } from '@aztec/foundation/sleep'; import { Timer } from '@aztec/foundation/timer'; -import { ExtRollupLibAbi, GovernanceProposerAbi, LeonidasLibAbi, RollupAbi } from '@aztec/l1-artifacts'; +import { GovernanceProposerAbi, RollupAbi } from '@aztec/l1-artifacts'; import { type TelemetryClient } from '@aztec/telemetry-client'; import pick from 'lodash.pick'; @@ -43,7 +43,7 @@ import { type BaseError, type Chain, type Client, - ContractFunctionExecutionError, + type ContractFunctionExecutionError, ContractFunctionRevertedError, type GetContractReturnType, type Hex, @@ -397,38 +397,6 @@ export class L1Publisher { if (error instanceof ContractFunctionRevertedError) { const err = error as ContractFunctionRevertedError; this.log.debug(`Validation failed: ${err.message}`, err.data); - } else if (error instanceof ContractFunctionExecutionError) { - let err = error as ContractFunctionRevertedError; - if (!tryGetCustomErrorName(err)) { - // If we get here, it's because the custom error no longer exists in Rollup.sol, - // but in another lib. The below reconstructs the error message. - try { - await this.publicClient.estimateGas({ - data: encodeFunctionData({ - abi: this.rollupContract.abi, - functionName: 'validateHeader', - args, - }), - account: this.account, - to: this.rollupContract.address, - }); - } catch (estGasErr: unknown) { - const possibleAbis = [ExtRollupLibAbi, LeonidasLibAbi]; - possibleAbis.forEach(abi => { - const possibleErr = getContractError(estGasErr as BaseError, { - args: [], - abi: abi, - functionName: 'validateHeader', - address: this.rollupContract.address, - sender: this.account.address, - }); - err = tryGetCustomErrorName(possibleErr) ? possibleErr : err; - }); - } - throw err; - } - } else { - this.log.debug(`Unexpected error during validation: ${error}`); } throw error; } @@ -649,8 +617,7 @@ export class L1Publisher { }, ], }); - // If the above passes, we have a blob error. We cannot simulate blob txs, and failed txs no longer throw errors, - // and viem provides no way to get the revert reason from a given tx. + // If the above passes, we have a blob error. We cannot simulate blob txs, and failed txs no longer throw errors. // Strangely, the only way to throw the revert reason as an error and provide blobs is prepareTransactionRequest. // See: https://github.com/wevm/viem/issues/2075 // This throws a EstimateGasExecutionError with the custom error information: @@ -662,13 +629,13 @@ export class L1Publisher { }); return undefined; } catch (simulationErr: any) { - // If we don't have a ContractFunctionExecutionError, we have a blob related error => use ExtRollupLibAbi to get the error msg. + // If we don't have a ContractFunctionExecutionError, we have a blob related error => use getContractError to get the error msg. const contractErr = simulationErr.name === 'ContractFunctionExecutionError' ? simulationErr : getContractError(simulationErr as BaseError, { args: [], - abi: ExtRollupLibAbi, + abi: RollupAbi, functionName: args.functionName, address: args.address, sender: this.account.address,