Skip to content

Commit

Permalink
print storage refunds
Browse files Browse the repository at this point in the history
Signed-off-by: Danil <deniallugo@gmail.com>
  • Loading branch information
Deniallugo committed Jan 5, 2024
1 parent 3f2858e commit 2c90b6a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ impl<S: WriteStorage, H: HistoryMode> VmStorageOracle for StorageOracle<S, H> {
// `INITIAL_STORAGE_WRITE_PUBDATA_BYTES` is the default amount of pubdata bytes the user pays for.
pubdata_bytes: (INITIAL_STORAGE_WRITE_PUBDATA_BYTES as u32) - price_to_pay,
});
tracing::debug!(?refund, ?storage_key, "refund for write");
self.returned_refunds.apply_historic_record(
VectorHistoryEvent::Push(refund.pubdata_refund()),
partial_query.timestamp,
Expand Down
3 changes: 3 additions & 0 deletions prover/witness_generator/src/storage_oracle.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use multivm::vm_latest::old_vm::utils::storage_key_of_log;
use zksync_types::{
zkevm_test_harness::zk_evm::abstractions::{RefundType, RefundedAmounts, Storage},
LogQuery, Timestamp,
Expand All @@ -24,7 +25,9 @@ impl<T: Storage> Storage for StorageOracle<T> {
_monotonic_cycle_counter: u32,
_partial_query: &LogQuery,
) -> RefundType {
let storage_key = storage_key_of_log(partial_query);
let pubdata_bytes = self.storage_refunds.next().expect("Missing refund");
tracing::debug!(?pubdata_bytes, ?storage_key, "refund for write");
RefundType::RepeatedWrite(RefundedAmounts {
pubdata_bytes,
ergs: 0,
Expand Down

0 comments on commit 2c90b6a

Please sign in to comment.