-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat!: add stateful precompiled contract (cherry-pick) #4
base: zeta-ethermint-based-0.47
Are you sure you want to change the base?
feat!: add stateful precompiled contract (cherry-pick) #4
Conversation
dongsam
commented
Jun 4, 2024
- (evm) Problem: precompile interface is not supported crypto-org-chain/ethermint#328 Support precompile interface.
- (statedb) Problem: don't support native action in statedb crypto-org-chain/ethermint#333 Support native action in statedb, prepare for precompiles.
- (precompile) Problem: native action don't support events crypto-org-chain/ethermint#338 Fix simulation of precompile using context.
- (precompile) Problem: native action don't support mem keys crypto-org-chain/ethermint#342 Problem: native action don't support mem keys
- (precompile) Problem: no api to convert native events to logs crypto-org-chain/ethermint#343 Problem: no api to convert native events to logs
- (precompile) Problem: converted native logs don't have contract address crypto-org-chain/ethermint#344 Fix error handling in precompile context.
- (precompile) Problem: EventConverter api shouldn't return multiple logs crypto-org-chain/ethermint#346 Add support for new precompile context.
- (precompile) Problem: miss contract in ExtStateDB interface crypto-org-chain/ethermint#347 Problem: miss contract in ExtStateDB interface
- (precompile) Problem: no efficient way to execute read-only native actions crypto-org-chain/ethermint#359 Problem: no efficient way to execute read-only native actions
- (precompile) Problem: precompiles don't have access to statedb crypto-org-chain/ethermint#371 Add StateDB itself into native context for precompiles to emit evm logs directly.
- (precompile) Problem: no interface to set the chain config for precompile contract crypto-org-chain/ethermint#380 Allow init precompiled contract with rules when new evm.
- (evm) crypto-org-chain#328 Support precompile interface. - (statedb) crypto-org-chain#333 Support native action in statedb, prepare for precompiles. - (precompile) crypto-org-chain#338 Fix simulation of precompile using context. - (precompile) crypto-org-chain#342 Problem: native action don't support mem keys - (precompile) crypto-org-chain#343 Problem: no api to convert native events to logs - (precompile) crypto-org-chain#344 Fix error handling in precompile context. - (precompile) crypto-org-chain#346 Add support for new precompile context. - (precompile) crypto-org-chain#347 Problem: miss contract in ExtStateDB interface - (precompile) crypto-org-chain#359 Problem: no efficient way to execute read-only native actions - (precompile) crypto-org-chain#371 Add StateDB itself into native context for precompiles to emit evm logs directly. - (precompile) crypto-org-chain#380 Allow init precompiled contract with rules when new evm.
for key, store := range cms.stores { | ||
stores[key] = store.Clone() | ||
} |
Check failure
Code scanning / gosec
the value in the range statement should be _ unless copying a map: want: for key := range m Error
for _, store := range cms.stores { | ||
store.Write() | ||
} |
Check failure
Code scanning / gosec
the value in the range statement should be _ unless copying a map: want: for key := range m Error
for _, key := range keys { | ||
stores[key] = parent.GetKVStore(key) | ||
} |
Check failure
Code scanning / gosec
the value in the range statement should be _ unless copying a map: want: for key := range m Error
for key, store := range cms.stores { | ||
otherStore, ok := ms.stores[key] | ||
if !ok { | ||
panic("Invariant violation: Restore should only be called on a store cloned from itself") | ||
} | ||
store.Restore(otherStore) | ||
} |
Check failure
Code scanning / gosec
the value in the range statement should be _ unless copying a map: want: for key := range m Error
for key, value := range t { | ||
storage[key] = make(Storage) | ||
for k, v := range value { | ||
storage[key][k] = v | ||
} | ||
} |
Check failure
Code scanning / gosec
the value in the range statement should be _ unless copying a map: want: for key := range m Error
for addr, c := range vm.DefaultPrecompiles(rules) { | ||
contracts[addr] = c | ||
active = append(active, addr) | ||
} |
Check failure
Code scanning / gosec
the value in the range statement should be _ unless copying a map: want: for key := range m Error
for key, store := range stores { | ||
if cms.TracingEnabled() { | ||
tctx := cms.traceContext.Clone().Merge(types.TraceContext{ | ||
storeNameCtxKey: key.Name(), | ||
}) | ||
|
||
store = tracekv.NewStore(store, cms.traceWriter, tctx) | ||
} | ||
cms.stores[key] = cachekv.NewStore(store) | ||
} |
Check failure
Code scanning / gosec
the value in the range statement should be _ unless copying a map: want: for key := range m Error
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days-before-close if no further activity occurs. |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days-before-close if no further activity occurs. |