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

feat: Simulate enqueued public functions and locate failing constraints on them #1853

Merged
merged 20 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
a509429
feat: first working version of simulate pub
sirasistant Aug 28, 2023
408c83c
feat: allow parsing nested public exec errors
sirasistant Aug 28, 2023
1ff4bd8
feat: sim errors with fn and noir call stacks
sirasistant Aug 29, 2023
3d14c40
Merge branch 'master' into arv/simulate_public
sirasistant Aug 29, 2023
8233a82
fix: cleanup
sirasistant Aug 29, 2023
7c09e7a
Merge branch 'arv/simulate_public' of github.com:AztecProtocol/aztec-…
sirasistant Aug 29, 2023
7eda8a4
test: fix test
sirasistant Aug 29, 2023
aba3018
fix: avoid simulations modifying state and txs
sirasistant Aug 29, 2023
4894747
fix: clone inside processor to avoid the mutation
sirasistant Aug 29, 2023
e706da1
Merge branch 'master' into arv/simulate_public
sirasistant Aug 29, 2023
213e465
refactor: improve printing of simulation errors
sirasistant Aug 29, 2023
7e9fad9
Merge branch 'arv/simulate_public' of github.com:AztecProtocol/aztec-…
sirasistant Aug 29, 2023
21e7a0b
feat: initial approach of transactional merkle db
sirasistant Aug 29, 2023
87b53b2
feat: option skip public sim & refactor trees txs
sirasistant Aug 29, 2023
ff46ce9
Merge branch 'master' into arv/simulate_public
sirasistant Aug 29, 2023
204386f
docs: added comment pointing to the created issue
sirasistant Aug 29, 2023
c90822a
Merge branch 'master' into arv/simulate_public
sirasistant Aug 29, 2023
98f2690
refactor: improvements after peer review
sirasistant Aug 30, 2023
c11a01f
Merge branch 'master' into arv/simulate_public
sirasistant Aug 30, 2023
e0db983
fix: improve enrichment
sirasistant Aug 30, 2023
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
Prev Previous commit
fix: improve enrichment
  • Loading branch information
sirasistant committed Aug 30, 2023
commit e0db98362452736124a045f0d6b12d4b49291a76
2 changes: 1 addition & 1 deletion yarn-project/acir-simulator/src/acvm/acvm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export async function acvm(
typedError = new Error(`Error in oracle callback ${err}`);
}
oracleError = typedError;
logger.error(`Error in oracle callback ${name}:`, typedError);
logger.error(`Error in oracle callback ${name}:`, typedError.message, typedError.stack);
throw typedError;
}
},
Expand Down
12 changes: 6 additions & 6 deletions yarn-project/aztec-rpc/src/aztec_rpc_server/aztec_rpc_server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ export class AztecRPCServer implements AztecRPC {
*/
async #enrichSimulationError(err: SimulationError) {
// Maps contract addresses to the set of functions selectors that were in error.
// Using strings because map and set doesn't use .equals()
// Using strings because map and set don't use .equals()
const mentionedFunctions: Map<string, Set<string>> = new Map();

err.getCallStack().forEach(({ contractAddress, functionSelector }) => {
Expand All @@ -485,15 +485,15 @@ export class AztecRPCServer implements AztecRPC {
});

await Promise.all(
Object.keys(mentionedFunctions).map(async contractAddress => {
const selectors = mentionedFunctions.get(contractAddress)!;
const contract = await this.db.getContract(AztecAddress.fromString(contractAddress));
[...mentionedFunctions.entries()].map(async ([contractAddress, selectors]) => {
const parsedContractAddress = AztecAddress.fromString(contractAddress);
const contract = await this.db.getContract(parsedContractAddress);
if (contract) {
err.enrichWithContractName(contract.address, contract.name);
err.enrichWithContractName(parsedContractAddress, contract.name);
selectors.forEach(selector => {
const functionAbi = contract.functions.find(f => f.selector.toString() === selector);
if (functionAbi) {
err.enrichWithFunctionName(contract.address, functionAbi.selector, functionAbi.name);
err.enrichWithFunctionName(parsedContractAddress, functionAbi.selector, functionAbi.name);
}
});
}
Expand Down