Skip to content

Commit 857ba8c

Browse files
committed
Fix acct inner state update in execute_transaction
1 parent 6d25aa8 commit 857ba8c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

crates/services/stf-runner/src/stf.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ pub fn process_block(
100100
state_accessor.set_cur_epoch(state_accessor.cur_epoch() + 1);
101101
}
102102

103-
// Increment cur slot ??
104-
// state_accessor.set_cur_slot(state_accessor.cur_slot() + 1);
103+
// Update cur slot after processing block
104+
state_accessor.set_slot(block.signed_header().header().slot());
105105

106106
// Set accounts root
107107
state_accessor.set_accounts_root(ledger_provider.root()?);

crates/services/stf-runner/src/tx_exec.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ fn execute_snark_update(
6868
snark_state.proof_state = update.data.new_state.clone();
6969
snark_state.seq_no += 1;
7070
acct_state.balance -= total_sent;
71+
acct_state.inner_state = AccountInnerState::Snark(snark_state);
72+
73+
// Save the updated account state back to the ledger
74+
ledger_provider.set_account_state(*acct_id, acct_state)?;
7175

7276
// Insert message to respective account
7377
for (acct_id, msg) in out_msgs {

0 commit comments

Comments
 (0)