-
Notifications
You must be signed in to change notification settings - Fork 11
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
EVM support #30
EVM support #30
Conversation
add basic support in sdk: - add a TxExecutor baseapp option - add TxIndex/TxCount/MsgIndex in context Update CHANGELOG.md Signed-off-by: yihuang <[email protected]> fix misspell fix lint run gci fix lint gci seems not compatible with gofumpt
Solution: - remove the api changelog
* Revert "build(deps): Bump github.com/cosmos/iavl from 1.0.1 to 1.1.1 in store (cosmos#19770)" This reverts commit ff30f6e. * Problem: store package has dependency issues Solution: - revert the iavl bump, v1.0.2 is the version referenced by outer packages
generic interface generic btree generic cachekv generic transient store support ObjStore changelog Update CHANGELOG.md Signed-off-by: yihuang <[email protected]> object store key Apply review suggestions fix merge conflict fix snapshot revert dependers
…s#237) * Problem: no efficient way to collect fee Solution: - support an idea of virtual account in bank module, where the incoming coins are accumulated in a per-tx object store first, then accumulate and credit to the real account at end blocker. it's nesserary to support parallel tx execution, where we try not to access shared states. more efficient sum support SendCoinsFromModuleToAccountVirtual fix test fix test * fix lint * fix test * fix test * fix test * fix test * fix test * fix mock keeper * try fix lint * try fix lint * reuse code * try fix linter * Update x/bank/keeper/send.go Signed-off-by: yihuang <[email protected]> * algin panic call * fix error handling * try fix lint * nolintlint generate falst postiive --------- Signed-off-by: yihuang <[email protected]>
…s#239) fix Update CHANGELOG.md Signed-off-by: yihuang <[email protected]> don't change interface
* Problem: MultiStore interface is bloated Solution: - Split out specialied methods from it, keeping the MultiStore generic * Update store/CHANGELOG.md Signed-off-by: yihuang <[email protected]> --------- Signed-off-by: yihuang <[email protected]>
* Problem: nested cache store not efficient Solution: - introduce copy-on-write btree based cache store temp * changelog * rename * Update store/cachekv/store.go Signed-off-by: yihuang <[email protected]> --------- Signed-off-by: yihuang <[email protected]>
Solution: - init cachestore on cachestore lazily. - cleanup some unused stuff. Update store/CHANGELOG.md Signed-off-by: yihuang <[email protected]>
* Support RunAtomic API * add unit test
fix and add test
Solution: - fix and add test to support the usage pattern in ethermint add Discard method to CacheWrap better testing
cosmos#239)" (cosmos#247) This reverts commit b693dd9.
* feat: save some memory allocations on un-used cache store * Update CHANGELOG.md Signed-off-by: yihuang <[email protected]> * Update store/internal/btree/btree.go Signed-off-by: yihuang <[email protected]> --------- Signed-off-by: yihuang <[email protected]>
Solution: - fix the way context is updated
Solution: - add checks
…osmos#258) Solution: - add API NewFromParent to cache multistore. Update store/CHANGELOG.md Signed-off-by: yihuang <[email protected]> fix test fix lint
* mutex don't cover GetSigners don't clone header in context * Update CHANGELOG.md Signed-off-by: yihuang <[email protected]> * update comment --------- Signed-off-by: yihuang <[email protected]>
Solution: - add API StreamingManager to allow extending the abci listeners, mainly for versiondb support Update CHANGELOG.md Signed-off-by: yihuang <[email protected]> cleanup
* Problem: x/tx not up to date to the released version Solution: - reset to the x/tx/0.13.1 * fix lint
Solution: - support bytes fields to support MsgEthereumTx Update CHANGELOG.md Signed-off-by: yihuang <[email protected]> fix test move changelog
…s#289) Update CHANGELOG.md cleanup upstream merged
* fix(x/bank): align query with multi denoms for send-enabled (cosmos#20028) * fix(client/v2): respect output format from client ctx (cosmos#20033)
* build(deps): Bump github.com/cosmos/gogoproto from 1.4.11 to 1.4.12 (cosmos#19811) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * feat(x/gov): emit proposer address in submit proposal event (backport cosmos#19842) (cosmos#19844) Co-authored-by: Aryan Tikarya <[email protected]> Co-authored-by: marbar3778 <[email protected]> Co-authored-by: Julien Robert <[email protected]> * feat(x/gov): emit depositor in `proposal_deposit` event (backport cosmos#19853) (cosmos#19859) Co-authored-by: Kien <[email protected]> Co-authored-by: Julien Robert <[email protected]> * reuse fromAddrString (minor cleanup) (cosmos#19881) * feat(client): replace `event-query-tx-for` with `wait-tx` (backport cosmos#19870) (cosmos#19887) * feat(server): add custom start handler (backport cosmos#19854) (cosmos#19884) Co-authored-by: Julien Robert <[email protected]> * build(deps): Bump cosmossdk.io/store from 1.0.2 to 1.1.0 (cosmos#19810) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: marbar3778 <[email protected]> Co-authored-by: Julien Robert <[email protected]> * docs(x/mint): Fix inconsistency in mint docs (backport cosmos#19915) (cosmos#19925) * build(deps): Bump github.com/cosmos/iavl from 1.1.1 to 1.1.2 (cosmos#19985) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Julien Robert <[email protected]> * fix(client/v2): add encoder for `cosmos.base.v1beta1.DecCoin` (backport cosmos#19976) (cosmos#20001) Co-authored-by: Julien Robert <[email protected]> * fix(mempool): use no-op mempool as default (backport cosmos#19970) (cosmos#20008) Co-authored-by: Tom <[email protected]> Co-authored-by: marbar3778 <[email protected]> Co-authored-by: Julien Robert <[email protected]> * feat: Conditionally emit metrics based on enablement (backport cosmos#19903) (cosmos#20017) Co-authored-by: Lucas Francisco López <[email protected]> Co-authored-by: Julien Robert <[email protected]> * fix(x/bank): align query with multi denoms for send-enabled (backport cosmos#20028) (cosmos#20029) Co-authored-by: mmsqe <[email protected]> * fix: Implement gogoproto customtype to secp256r1 keys (backport cosmos#20027) (cosmos#20031) Co-authored-by: Facundo Medica <[email protected]> * fix(client/v2): respect output format from client ctx (backport cosmos#20033) (cosmos#20046) Co-authored-by: mmsqe <[email protected]> * build(deps): Bump cosmossdk.io/x/tx from 0.13.1 to 0.13.2 (cosmos#20042) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Julien Robert <[email protected]> * feat(x/bank): support depinject for send restrictions (backport cosmos#20014) (cosmos#20024) * fix(baseapp): don't share global gas meter in tx execution (backport cosmos#19616) (cosmos#20050) * fix: secp256r1 json missing quotes (backport cosmos#20060) (cosmos#20069) Co-authored-by: Facundo Medica <[email protected]> * build(deps): Bump github.com/cosmos/cosmos-proto from 1.0.0-beta.4 to 1.0.0-beta.5 (cosmos#20095) * feat(client/v2): implement version filtering using annotation (backport cosmos#20083) (cosmos#20099) Co-authored-by: Julien Robert <[email protected]> * chore: prepare v0.50.6 (cosmos#19998) * fix: use timestamp for sim log file name (backport cosmos#20108) (cosmos#20111) Co-authored-by: mmsqe <[email protected]> * fix(x/authz,x/feegrant): check blocked address (cosmos#20102) * chore: update v0.50.6 release notes (cosmos#20124) * build(deps): bump sdk in modules (cosmos#20126) * docs(gas/fees): Update block gas documentation (backport cosmos#20128) (cosmos#20131) Co-authored-by: samricotta <[email protected]> * fix(baseapp): avoid header height overwrite block height (backport cosmos#20107) (cosmos#20129) Co-authored-by: mmsqe <[email protected]> Co-authored-by: Julien Robert <[email protected]> * docs: fix broken link (backport cosmos#20133) (cosmos#20138) * build(deps): bump modules in simapp (cosmos#20137) * build(deps): Bump cosmossdk.io/x/tx from 0.13.2 to 0.13.3 (cosmos#20152) * docs: add authz reference info in the circuit antehandler (backport cosmos#20146) (cosmos#20155) Co-authored-by: Reece Williams <[email protected]> * fix(testsuite/sims): set all signatures (backport cosmos#20151) (cosmos#20185) Co-authored-by: Leon <[email protected]> * build(deps): Bump github.com/cometbft/cometbft from 0.38.6 to 0.38.7 (cosmos#20206) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * fix(server): bootstrap-state command can't parse latest genesis format (backport cosmos#20020) (cosmos#20045) Co-authored-by: yihuang <[email protected]> Co-authored-by: Julien Robert <[email protected]> Co-authored-by: sontrinh16 <[email protected]> Co-authored-by: marbar3778 <[email protected]> * fix: remove txs from mempool when antehandler fails in recheck (backport cosmos#20144) (cosmos#20251) Co-authored-by: Marko <[email protected]> * fix resolve * align dependencies --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Aryan Tikarya <[email protected]> Co-authored-by: marbar3778 <[email protected]> Co-authored-by: Julien Robert <[email protected]> Co-authored-by: Kien <[email protected]> Co-authored-by: yihuang <[email protected]> Co-authored-by: Tom <[email protected]> Co-authored-by: Lucas Francisco López <[email protected]> Co-authored-by: Facundo Medica <[email protected]> Co-authored-by: samricotta <[email protected]> Co-authored-by: Reece Williams <[email protected]> Co-authored-by: Leon <[email protected]> Co-authored-by: sontrinh16 <[email protected]> Co-authored-by: Marko <[email protected]>
…osmos#507) * Problem: mempool don't respect gas wanted returned by ante handler Solution: - support custom gas wanted in mempool * Update CHANGELOG.md Signed-off-by: yihuang <[email protected]> * cleanup * cleanup * fix priorityIndex * fix process proposal * fix lint * fix lint --------- Signed-off-by: yihuang <[email protected]>
* Problem: redundant mutex for InsertWithGasWanted cfg of PriorityNonceMempool remains unchanged once assigned, so no lock is required * make mocks * cleanup * keep order of check MaxTx
for _, store := range cms.stores { | ||
store.Discard() | ||
} |
Check warning
Code scanning / CodeQL
Iteration over map Warning
store = cms.initStore(key, cms.parentStore(key)) | ||
} | ||
if key == nil || store == nil { | ||
panic(fmt.Sprintf("kv store with key %v has not been registered in stores", key)) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods Warning
panic(fmt.Sprintf("kv store with key %v has not been registered in stores", key)) | ||
store, ok := cms.getCacheWrapper(key).(types.KVStore) | ||
if !ok { | ||
panic(fmt.Sprintf("store with key %v is not KVStore", key)) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods Warning
for k, v := range cms.stores { | ||
if _, ok := other.stores[k]; !ok { | ||
// clear the cache store if it's not in the other | ||
v.Discard() | ||
} | ||
} |
Check warning
Code scanning / CodeQL
Iteration over map Warning
for k, v := range other.stores { | ||
store, ok := cms.stores[k] | ||
if !ok { | ||
store = cms.initStore(k, cms.parentStore(k)) | ||
} | ||
|
||
store.(types.BranchStore).Restore(v.(types.BranchStore)) | ||
} |
Check warning
Code scanning / CodeQL
Iteration over map Warning
func (ts *BTreeStore[V]) ReverseIterator(start, end []byte) types.GIterator[V] { | ||
it, err := ts.BTree.ReverseIterator(start, end) | ||
if err != nil { | ||
panic(err) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods Warning
store := types.KVStore(s) | ||
store, ok := s.(types.KVStore) | ||
if !ok { | ||
panic(fmt.Sprintf("store with key %v is not KVStore", key)) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods Warning
// AssertValidValueLength checks if the value length is within length limit | ||
func AssertValidValueLength(l int) { | ||
if l > MaxValueLength { | ||
panic(errors.New("value is too large")) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods Warning
for key := range okeys { | ||
cms.MountStoreWithDB(okeys[key], storetypes.StoreTypeObject, nil) | ||
} |
Check warning
Code scanning / CodeQL
Iteration over map Warning test
@@ -8,4 +8,5 @@ | |||
// EndBlocker is called every block, emits balance event | |||
func EndBlocker(ctx sdk.Context, k keeper.Keeper) { | |||
k.EmitAllTransientBalances(ctx) | |||
k.CreditVirtualAccounts(ctx) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods Warning
path flow from Begin/EndBlock to a panic call
path flow from Begin/EndBlock to a panic call
path flow from Begin/EndBlock to a panic call
path flow from Begin/EndBlock to a panic call
baseapp/abci.go
Outdated
ProposerAddress: req.ProposerAddress, | ||
NextValidatorsHash: req.NextValidatorsHash, | ||
AppHash: app.LastCommitID().Hash, | ||
LastBlockId: cmtproto.BlockID{ | ||
Hash: req.LastBlockHash, | ||
PartSetHeader: cmtproto.PartSetHeader{ | ||
Total: uint32(req.LastBlockPartSetTotal), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change potentially affects state.
Call sequence:
(*github.com/cosmos/cosmos-sdk/baseapp.BaseApp).internalFinalizeBlock (baseapp/abci.go:703)
(*github.com/cosmos/cosmos-sdk/baseapp.BaseApp).FinalizeBlock (baseapp/abci.go:876)
baseapp/abci.go
Outdated
Time: req.Time, | ||
ProposerAddress: req.ProposerAddress, | ||
NextValidatorsHash: req.NextValidatorsHash, | ||
AppHash: app.LastCommitID().Hash, | ||
AppHash: req.AppHash, | ||
ValidatorsHash: req.ValidatorsHash, | ||
ConsensusHash: req.ConsensusHash, | ||
DataHash: req.DataHash, | ||
EvidenceHash: req.EvidenceHash, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change potentially affects state.
Call sequence:
(*github.com/cosmos/cosmos-sdk/baseapp.BaseApp).internalFinalizeBlock (baseapp/abci.go:703)
(*github.com/cosmos/cosmos-sdk/baseapp.BaseApp).FinalizeBlock (baseapp/abci.go:876)
This PR must not include things that are not directly related to EVM. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to cut this out and all deps of it. I suggest instead cherry picking what's really relevant to EVM.
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
baseapp/abci.go
Outdated
ProposerAddress: req.ProposerAddress, | ||
NextValidatorsHash: req.NextValidatorsHash, | ||
AppHash: app.LastCommitID().Hash, | ||
ValidatorsHash: req.ValidatorsHash, | ||
ConsensusHash: req.ConsensusHash, | ||
DataHash: req.DataHash, | ||
EvidenceHash: req.EvidenceHash, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change potentially affects state.
Call sequence:
(*github.com/cosmos/cosmos-sdk/baseapp.BaseApp).internalFinalizeBlock (baseapp/abci.go:703)
(*github.com/cosmos/cosmos-sdk/baseapp.BaseApp).FinalizeBlock (baseapp/abci.go:876)
789f4f2
to
7be9b7c
Compare
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
No description provided.