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

feat!: add stateful precompiled contract (cherry-pick) #4

Draft
wants to merge 1 commit into
base: zeta-ethermint-based-0.47
Choose a base branch
from

Conversation

dongsam
Copy link
Member

@dongsam dongsam commented Jun 4, 2024

- (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.
@github-actions github-actions bot added the C:CLI label Jun 4, 2024
Comment on lines +128 to +130
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

the value in the range statement should be _ unless copying a map: want: for key := range m
Comment on lines +119 to +121
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

the value in the range statement should be _ unless copying a map: want: for key := range m
Comment on lines +64 to +66
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

the value in the range statement should be _ unless copying a map: want: for key := range m
Comment on lines +142 to +148
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

expected exactly 1 statement (either append, delete, or copying to another map) in a range with a map, got 3
Comment on lines +51 to +56
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

expected exactly 1 statement (either append, delete, or copying to another map) in a range with a map, got 2
Comment on lines +77 to +80
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

expected exactly 1 statement (either append, delete, or copying to another map) in a range with a map, got 2
Comment on lines +45 to +54
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

expected exactly 1 statement (either append, delete, or copying to another map) in a range with a map, got 2
Copy link

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.

Copy link

github-actions bot commented Sep 4, 2024

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.

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

Successfully merging this pull request may close these issues.

1 participant