Skip to content

Integrate with tendermint EVM tx replacement logic#1394

Closed
codchen wants to merge 1 commit intoevmfrom
evm-replacement
Closed

Integrate with tendermint EVM tx replacement logic#1394
codchen wants to merge 1 commit intoevmfrom
evm-replacement

Conversation

@codchen
Copy link
Collaborator

@codchen codchen commented Feb 28, 2024

Describe your changes and provide context

See description in sei-protocol/sei-tendermint#206

This PR also includes changes to handle duplicate nonces in the pending nonce list in evmKeeper

Testing performed to validate your change

local sei test

Block time -> 10s

block 1
seid tx evm send 0x9f76969569764cFc33D597D0eb00242cDB11EAE2 1000 --from=admin --nonce=0 --gas-fee-cap=1000000000000
seid tx evm send 0x9f76969569764cFc33D597D0eb00242cDB11EAE2 2000 --from=admin --nonce=0 --gas-fee-cap=1100000000000

block 1
seid tx evm send 0x9f76969569764cFc33D597D0eb00242cDB11EAE2 1000 --from=admin --nonce=0 --gas-fee-cap=1000000000000
seid tx evm send 0x9f76969569764cFc33D597D0eb00242cDB11EAE2 2000 --from=admin --nonce=0 --gas-fee-cap=900000000000

block 1
seid tx evm send 0x9f76969569764cFc33D597D0eb00242cDB11EAE2 1000 --from=admin --nonce=0 --gas-fee-cap=1000000000000
seid tx evm send 0x9f76969569764cFc33D597D0eb00242cDB11EAE2 2000 --from=admin --nonce=2 --gas-fee-cap=1000000000000
seid tx evm send 0x9f76969569764cFc33D597D0eb00242cDB11EAE2 3000 --from=admin --nonce=2 --gas-fee-cap=1100000000000
block 2
seid tx evm send 0x9f76969569764cFc33D597D0eb00242cDB11EAE2 10000 --from=admin --nonce=1 --gas-fee-cap=1000000000000
seid tx evm send 0x9f76969569764cFc33D597D0eb00242cDB11EAE2 100000 --from=admin --nonce=3 --gas-fee-cap=1000000000000

block 1
seid tx evm send 0x9f76969569764cFc33D597D0eb00242cDB11EAE2 1000 --from=admin --nonce=0 --gas-fee-cap=1000000000000
seid tx evm send 0x9f76969569764cFc33D597D0eb00242cDB11EAE2 2000 --from=admin --nonce=2 --gas-fee-cap=1000000000000
seid tx evm send 0x9f76969569764cFc33D597D0eb00242cDB11EAE2 3000 --from=admin --nonce=2 --gas-fee-cap=900000000000
block 2
seid tx evm send 0x9f76969569764cFc33D597D0eb00242cDB11EAE2 10000 --from=admin --nonce=1 --gas-fee-cap=1000000000000
seid tx evm send 0x9f76969569764cFc33D597D0eb00242cDB11EAE2 100000 --from=admin --nonce=3 --gas-fee-cap=1000000000000

@codecov
Copy link

codecov bot commented Feb 28, 2024

Codecov Report

❌ Patch coverage is 90.19608% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.32%. Comparing base (f23a1fa) to head (4ab8c40).

Files with missing lines Patch % Lines
x/evm/keeper/keeper.go 89.36% 5 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##              evm    #1394      +/-   ##
==========================================
+ Coverage   63.02%   63.32%   +0.30%     
==========================================
  Files         350      350              
  Lines       23760    23788      +28     
==========================================
+ Hits        14974    15064      +90     
+ Misses       7926     7861      -65     
- Partials      860      863       +3     
Files with missing lines Coverage Δ
app/app.go 68.44% <100.00%> (+0.02%) ⬆️
x/evm/ante/sig.go 84.12% <100.00%> (ø)
x/evm/keeper/keeper.go 85.64% <89.36%> (+1.71%) ⬆️

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

if err != nil {
return err
var nonce uint64
if n, err := cmd.Flags().GetInt64(FlagNonce); err == nil && n >= 0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's add --nonce to the command usage string?

if pendingTx.Nonce == nonce {
if priority > pendingTx.Priority {
// replace existing tx
delete(k.keyToNonce, pendingTx.Key)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we also need to update tendermint's pending tx list somewhere here? i don't think so but wanted to double check

@udpatil udpatil deleted the branch evm October 31, 2025 14:03
@udpatil udpatil closed this Oct 31, 2025
@masih masih deleted the evm-replacement branch October 31, 2025 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants