Skip to content
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

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

ganeshvanahalli
Copy link
Contributor

@ganeshvanahalli ganeshvanahalli commented Aug 22, 2024

Pulled by OffchainLabs/nitro#2602

Part of NIT-2733

@cla-bot cla-bot bot added the s CLA signed label Aug 22, 2024
eth/tracers/native/prestate.go Outdated Show resolved Hide resolved
eth/tracers/native/prestate.go Outdated Show resolved Hide resolved
diegoximenes
diegoximenes previously approved these changes Sep 5, 2024
Base automatically changed from merge-1.14.0 to master November 6, 2024 01:07
@tsahee tsahee dismissed diegoximenes’s stale review November 6, 2024 01:07

The base branch was changed.

eth/tracers/native/prestate.go Outdated Show resolved Hide resolved
eth/tracers/native/prestate.go Outdated Show resolved Hide resolved
diegoximenes
diegoximenes previously approved these changes Nov 19, 2024
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)
Copy link
Contributor

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.

@@ -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
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s CLA signed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants