Skip to content

Commit 16ec222

Browse files
authored
Merge pull request #4802 from namada-net/mergify/bp/maint-libs-0.251/pr-4800
clear the tx gas map after block commit (backport #4800)
2 parents 54851de + 1c9aa29 commit 16ec222

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- Clear tx gas map after every block to avoid indefinite accumulation
2+
([\#4800](https://github.com/anoma/namada/pull/4800))

crates/state/src/wl_state.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,12 @@ where
291291
let mut batch = D::batch();
292292
self.commit_write_log_block(&mut batch)
293293
.into_storage_result()?;
294-
self.commit_block_from_batch(batch).into_storage_result()
294+
self.commit_block_from_batch(batch).into_storage_result()?;
295+
296+
// Clear the tx gas map
297+
self.in_mem.commit_only_data.tx_gas = Default::default();
298+
299+
Ok(())
295300
}
296301

297302
/// Commit the current block's write log to the storage. Starts a new block

0 commit comments

Comments
 (0)