Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove abi refs from publisher #10766

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions noir-projects/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion noir-projects/noir-protocol-circuits/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)}
Expand Down
43 changes: 5 additions & 38 deletions yarn-project/sequencer-client/src/publisher/l1-publisher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -43,7 +43,7 @@ import {
type BaseError,
type Chain,
type Client,
ContractFunctionExecutionError,
type ContractFunctionExecutionError,
ContractFunctionRevertedError,
type GetContractReturnType,
type Hex,
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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:
Expand All @@ -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,
Expand Down
Loading