-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrate CaptureArbitrumStorageGet/Set into the prestate tracer #352
base: master
Are you sure you want to change the base?
Integrate CaptureArbitrumStorageGet/Set into the prestate tracer #352
Conversation
…et-prestatetracer
…]et initialization for prestateTracer
Co-authored-by: Diego Ximenes Mendes <[email protected]>
core/tracing/hooks.go
Outdated
CaptureArbitrumStorageGetHook = func(key common.Hash, depth int, before bool) | ||
CaptureArbitrumStorageSetHook = func(key, value common.Hash, depth int, before bool) | ||
CaptureArbitrumStorageGetHook = func(addr common.Address, key, mappedKey common.Hash, depth int, before bool) | ||
CaptureArbitrumStorageSetHook = func(addr common.Address, key, mappedKey, value common.Hash, depth int, before bool) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addr should always be the arbosStorage address. We can add it here but not really necessary.
We shouldn't need mapped key because that's what "key" should mean. Storage is just key-value pairs and we don't care about the non-mapped key.
eth/tracers/native/prestate.go
Outdated
@@ -47,10 +47,13 @@ type account struct { | |||
Nonce uint64 `json:"nonce,omitempty"` | |||
Storage map[common.Hash]common.Hash `json:"storage,omitempty"` | |||
empty bool | |||
|
|||
ArbitrumStorage map[common.Hash]common.Hash `json:"arbitrumStorage,omitempty"` | |||
arbStorageKeyMap map[common.Hash]common.Hash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prestate is just about finding all the places in storage that chaged.
We're not trying to add new things there. It already supports writes that happen during EVM by mimicing an SLOAD/SSTORE.
We just want to add the accesses that happened before EVM execution to the same place.
So we shouldn't need new entries. It should all be normal entries in the arbosstorage account.
Pulled by OffchainLabs/nitro#2602
Part of NIT-2733