Skip to content

Commit

Permalink
use new MessageRunContext method names
Browse files Browse the repository at this point in the history
  • Loading branch information
magicxyyz committed Nov 14, 2024
1 parent a8dfeb6 commit 4fb1df6
Show file tree
Hide file tree
Showing 4 changed files with 592 additions and 8 deletions.
4 changes: 2 additions & 2 deletions arbos/programs/native.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ func handleReqImpl(apiId usize, req_type u32, data *rustSlice, costPtr *u64, out
// Caches a program in Rust. We write a record so that we can undo on revert.
// For gas estimation and eth_call, we ignore permanent updates and rely on Rust's LRU.
func cacheProgram(db vm.StateDB, module common.Hash, program Program, addressForLogging common.Address, code []byte, codeHash common.Hash, params *StylusParams, debug bool, time uint64, runCtx *core.MessageRunContext) {
if runCtx.IsChainTip() {
if runCtx.IsCommitMode() {
// address is only used for logging
asm, err := getLocalAsm(db, module, addressForLogging, code, codeHash, params.PageLimit, time, debug, program, runCtx)
if err != nil {
Expand All @@ -389,7 +389,7 @@ func cacheProgram(db vm.StateDB, module common.Hash, program Program, addressFor
// Evicts a program in Rust. We write a record so that we can undo on revert, unless we don't need to (e.g. expired)
// For gas estimation and eth_call, we ignore permanent updates and rely on Rust's LRU.
func evictProgram(db vm.StateDB, module common.Hash, version uint16, debug bool, runCtx *core.MessageRunContext, forever bool) {
if runCtx.IsChainTip() {
if runCtx.IsCommitMode() {
tag := runCtx.WasmCacheTag()
state.EvictWasmRust(module, version, tag, debug)
if !forever {
Expand Down
Loading

0 comments on commit 4fb1df6

Please sign in to comment.