Skip to content

Commit

Permalink
Add miner basic data and codehash to system access witness
Browse files Browse the repository at this point in the history
  • Loading branch information
acolytec3 committed Dec 24, 2024
1 parent 6449b5e commit ec286f9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/vm/src/runTx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import {
KECCAK256_NULL,
MAX_UINT64,
SECP256K1_ORDER_DIV_2,
VERKLE_BASIC_DATA_LEAF_KEY,
VERKLE_CODE_HASH_LEAF_KEY,
bytesToBigInt,
bytesToHex,
bytesToUnprefixedHex,
Expand Down Expand Up @@ -669,6 +671,17 @@ async function _runTx(vm: VM, opts: RunTxOpts): Promise<RunTxResult> {
vm.evm.verkleAccessWitness.touchAndChargeProofOfAbsence(miner)
}
minerAccount = new Account()
// Add the miner account to the system verkle access witness
vm.evm.systemVerkleAccessWitness?.touchAddressOnWriteAndComputeGas(
miner,
0,
VERKLE_BASIC_DATA_LEAF_KEY,
)
vm.evm.systemVerkleAccessWitness?.touchAddressOnWriteAndComputeGas(
miner,
0,
VERKLE_CODE_HASH_LEAF_KEY,
)
}
// add the amount spent on gas to the miner's account
results.minerValue = vm.common.isActivatedEIP(1559)
Expand Down

0 comments on commit ec286f9

Please sign in to comment.