Skip to content

Commit 22d4ca9

Browse files
authored
fix: phase and fee fixes to AVM sim and tracegen (#16540)
2 parents a6eebac + 9c5b57f commit 22d4ca9

File tree

5 files changed

+11
-12
lines changed

5 files changed

+11
-12
lines changed

barretenberg/cpp/src/barretenberg/vm2/simulation/execution.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,8 +1144,6 @@ ExecutionResult Execution::execute(std::unique_ptr<ContextInterface> enqueued_ca
11441144

11451145
// State after the opcode.
11461146
ex_event.after_context_event = context.serialize_context_event();
1147-
// TODO(dbanks12): fix phase. Should come from TX execution and be forwarded to nested calls.
1148-
ex_event.after_context_event.phase = TransactionPhase::APP_LOGIC;
11491147
events.emit(std::move(ex_event));
11501148

11511149
// If the context has halted, we need to exit the external call.

barretenberg/cpp/src/barretenberg/vm2/simulation/tx_execution.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,7 @@ void TxExecution::simulate(const Tx& tx)
174174
tx_context.side_effect_states = result.side_effect_states;
175175
// Check what to do here for GAS
176176
emit_public_call_request(*tx.teardownEnqueuedCall,
177-
// TODO(dbanks12): This should be TEARDOWN.
178-
TransactionPhase::APP_LOGIC,
177+
TransactionPhase::TEARDOWN,
179178
fee,
180179
result.success,
181180
start_gas,

barretenberg/cpp/src/barretenberg/vm2/tracegen/execution_trace.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,9 +350,10 @@ void ExecutionTraceBuilder::process(
350350
{ C::execution_context_id, ex_event.after_context_event.id },
351351
{ C::execution_parent_id, ex_event.after_context_event.parent_id },
352352
{ C::execution_pc, ex_event.before_context_event.pc },
353-
{ C::execution_is_static, ex_event.after_context_event.is_static },
354353
{ C::execution_msg_sender, ex_event.after_context_event.msg_sender },
355354
{ C::execution_contract_address, ex_event.after_context_event.contract_addr },
355+
{ C::execution_transaction_fee, ex_event.after_context_event.transaction_fee },
356+
{ C::execution_is_static, ex_event.after_context_event.is_static },
356357
{ C::execution_parent_calldata_addr, ex_event.after_context_event.parent_cd_addr },
357358
{ C::execution_parent_calldata_size, ex_event.after_context_event.parent_cd_size_addr },
358359
{ C::execution_last_child_returndata_addr, ex_event.after_context_event.last_child_rd_addr },

yarn-project/bb-prover/src/avm_proving_tests/avm_check_circuit1.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
1212

1313
import { AvmProvingTester } from './avm_proving_tester.js';
1414

15-
const TIMEOUT = 100_000;
15+
const TIMEOUT = 30_000;
1616

1717
describe.skip('AVM check-circuit – unhappy paths 1', () => {
1818
let avmTestContractInstance: ContractInstanceWithAddress;

yarn-project/bb-prover/src/avm_proving_tests/avm_check_circuit2.test.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
55

66
import { AvmProvingTester } from './avm_proving_tester.js';
77

8-
const TIMEOUT = 100_000;
8+
const TIMEOUT = 30_000;
99

10-
describe.skip('AVM check-circuit – unhappy paths 2', () => {
10+
describe('AVM check-circuit – unhappy paths 2', () => {
1111
const sender = AztecAddress.fromNumber(42);
1212
let avmTestContractInstance: ContractInstanceWithAddress;
1313
let tester: AvmProvingTester;
@@ -21,7 +21,7 @@ describe.skip('AVM check-circuit – unhappy paths 2', () => {
2121
);
2222
});
2323

24-
it(
24+
it.skip(
2525
'an exceptional halt due to a nested call to non-existent contract is propagated to top-level',
2626
async () => {
2727
await tester.simProveVerifyAppLogic(
@@ -44,7 +44,7 @@ describe.skip('AVM check-circuit – unhappy paths 2', () => {
4444
// TIMEOUT,
4545
// );
4646

47-
it('top-level exceptional halts due to a non-existent contract in app-logic and teardown', async () => {
47+
it.skip('top-level exceptional halts due to a non-existent contract in app-logic and teardown', async () => {
4848
// don't insert contracts into trees, and make sure retrieval fails
4949
const tester = await AvmProvingTester.new(/*checkCircuitOnly=*/ true);
5050
await tester.simProveVerify(
@@ -62,7 +62,8 @@ describe.skip('AVM check-circuit – unhappy paths 2', () => {
6262
);
6363
});
6464

65-
it(
65+
// TODO: unskip once internalcall constraints are fixed (DEFAULT_PROPAGATE_CALL_ID in particular)
66+
it.skip(
6667
'enqueued calls in every phase, with enqueued calls that depend on each other',
6768
async () => {
6869
await tester.simProveVerify(
@@ -85,7 +86,7 @@ describe.skip('AVM check-circuit – unhappy paths 2', () => {
8586
},
8687
TIMEOUT,
8788
);
88-
it(
89+
it.skip(
8990
'Should prove and verify a TX that reverts in teardown',
9091
async () => {
9192
await tester.simProveVerify(

0 commit comments

Comments
 (0)