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

Stylus cache tag #319

Merged
merged 5 commits into from
May 21, 2024
Merged
Changes from 1 commit
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
11 changes: 10 additions & 1 deletion arbitrum/apibackend.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ var (
type APIBackend struct {
b *Backend

dbForAPICalls ethdb.Database

fallbackClient types.FallbackClient
sync SyncProgressBackend
}
Expand Down Expand Up @@ -101,8 +103,15 @@ func createRegisterAPIBackend(backend *Backend, filterConfig filters.Config, fal
if err != nil {
return nil, err
}
// discard stylus-tag on any call made from api database
dbForAPICalls := backend.chainDb
wasmStore, tag := backend.chainDb.WasmDataBase()
if tag != 0 {
dbForAPICalls = rawdb.WrapDatabaseWithWasm(backend.chainDb, wasmStore, tag)
PlasmaPower marked this conversation as resolved.
Show resolved Hide resolved
}
backend.apiBackend = &APIBackend{
b: backend,
dbForAPICalls: dbForAPICalls,
fallbackClient: fallbackClient,
}
filterSystem := filters.NewFilterSystem(backend.apiBackend, filterConfig)
Expand Down Expand Up @@ -314,7 +323,7 @@ func (a *APIBackend) FeeHistory(
}

func (a *APIBackend) ChainDb() ethdb.Database {
return a.b.chainDb
return a.dbForAPICalls
}

func (a *APIBackend) AccountManager() *accounts.Manager {
Expand Down
Loading