Skip to content

AsmSizeEstimateKb in CacheWasmRust #351

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

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions core/state/journal_arbitrum.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func (ch wasmActivation) dirtied() *common.Address {
}

// Updates the Rust-side recent program cache
var CacheWasmRust func(asm []byte, moduleHash common.Hash, version uint16, tag uint32, debug bool) = func([]byte, common.Hash, uint16, uint32, bool) {}
var CacheWasmRust func(asm []byte, moduleHash common.Hash, asmSizeEstimateKb uint32, version uint16, tag uint32, debug bool) = func([]byte, common.Hash, uint32, uint16, uint32, bool) {}
var EvictWasmRust func(moduleHash common.Hash, version uint16, tag uint32, debug bool) = func(common.Hash, uint16, uint32, bool) {}

type CacheWasm struct {
Expand All @@ -37,17 +37,18 @@ func (ch CacheWasm) dirtied() *common.Address {
}

type EvictWasm struct {
ModuleHash common.Hash
Version uint16
Tag uint32
Debug bool
ModuleHash common.Hash
Version uint16
Tag uint32
Debug bool
AsmSizeEstimateKb uint32
}

func (ch EvictWasm) revert(s *StateDB) {
asm, err := s.TryGetActivatedAsm(rawdb.LocalTarget(), ch.ModuleHash) // only happens in native mode
if err == nil && len(asm) != 0 {
//if we failed to get it - it's not in the current rust cache
CacheWasmRust(asm, ch.ModuleHash, ch.Version, ch.Tag, ch.Debug)
CacheWasmRust(asm, ch.ModuleHash, ch.AsmSizeEstimateKb, ch.Version, ch.Tag, ch.Debug)
}
}

Expand Down
Loading