# Update 17 ## week 17 updates This week I focused on going through geth's implementation of eip-4762 in detail: * There’re two main places where gas cost changes and handling access events happen: * The message call logic * Particular instructions that affect the witness * This function: https://github.com/gballet/go-ethereum/blob/jsign-witness-fix/core/state_transition.go#L352 has the main logic for executing a state transition. * Some examples: * Quite early in that method logic, the `tx.from` and `tx.to` charging are done here: https://github.com/gballet/go-ethereum/blob/jsign-witness-fix/core/state_transition.go#L396-L399. * Close to the end loop touches the coinbase if it’s receiving fees https://github.com/gballet/go-ethereum/blob/jsign-witness-fix/core/state_transition.go#L456 * When processing withdrawals, loop does the specd accesses here https://github.com/gballet/go-ethereum/blob/jsign-witness-fix/consensus/beacon/consensus.go#L361 * When a contract is created loop touches the code-chunks leaf values that will be written https://github.com/gballet/go-ethereum/blob/jsign-witness-fix/core/vm/evm.go#L531 * handling of access and write events: https://github.com/gballet/go-ethereum/blob/jsign-witness-fix/core/vm/instructions.go. In this file the op*(...) methods implement the logic for each instruction. here we can see that on witness affecting instructions, there’s an IsVerkle if condition where the proper access events are made (and gas charging). For example, for BLOCKHASH (https://github.com/gballet/go-ethereum/blob/jsign-witness-fix/core/vm/instructions.go#L518-L524) loop needs to access the data stored in the EIP-2935 contract, so loop touches the proper storage slot so it’s added in the witness and charged. Another example, for SSTORE https://github.com/gballet/go-ethereum/blob/jsign-witness-fix/core/vm/instructions.go#L613-L617 loop does a similar thing. * The Touch*(...) methods, which are all implemented in https://github.com/gballet/go-ethereum/blob/jsign-witness-fix/core/state/access_witness.go. That’s how geth handles read and write access events tracking and charging. At the end of the day, everything calls a single function but since all these Touch*(...) are high level helpers with the right parameters. * DB related changes: There’s a new db key prefix verkle where verkle- `path to node` contains the serialized version of the tree node. Note that `path to node` can be a partial path. ## week 18 roadmap Implement all these changes in reth, taking insipiration from the above modifications and nethermind changes: https://hackmd.io/nrSc5qvOSNmjPJqqG9BMxQ