Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
- Handle ignored error from TotalBondedTokens in pickReferenceDenom [#230](https://github.com/KiiChain/kiichain/issues/230)
- Handle error in pickReferenceDenom instead of panic to prevent consensus failure [#203](https://github.com/KiiChain/kiichain/issues/203)

- Disable EVM mempool due to bug on public nodes broadcast
- Fixed EVM mempool public nodes broadcast bug
- Fixed Ledger failure on linux nano
- Fixed ledger usage of default chain ID
- Remove references to time.Now() on release schedule validation
- Fix Oracle precompile ParseGetTwapsArgs missing validation for lookbackPeriod [#204](https://github.com/KiiChain/kiichain/issues/204)
- Remove unsafe math.Sqrt usage in oracle ballot standard deviation calculation
Expand Down
9 changes: 3 additions & 6 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,12 +273,9 @@ func NewKiichainApp(
maxGasWanted := cast.ToUint64(appOpts.Get(srvflags.EVMMaxTxGasWanted))
app.setAnteHandler(app.txConfig, maxGasWanted, appOpts)

// set the EVM priority nonce mempool
// Mempool is currently disabled due to a bug in EVM mempool on public nodes
// It will be enabled again once the bug is fixed on EVM
// if evmtypes.GetChainConfig() != nil {
// app.SetupEVMMempool(appOpts, logger)
// }
if evmtypes.GetChainConfig() != nil {
app.configureEVMMempool(appOpts, logger)
}

if manager := app.SnapshotManager(); manager != nil {
err = manager.RegisterExtensions(wasmkeeper.NewWasmSnapshotter(app.CommitMultiStore(), &app.WasmKeeper))
Expand Down
5 changes: 2 additions & 3 deletions app/evm_mempool.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
)

// configureEVMMempool sets up the EVM mempool and related handlers using viper configuration.
func (app *KiichainApp) configureEVMMempool(appOpts servertypes.AppOptions, logger log.Logger) { //nolint:unused
func (app *KiichainApp) configureEVMMempool(appOpts servertypes.AppOptions, logger log.Logger) {
if evmtypes.GetChainConfig() == nil {
logger.Debug("evm chain config is not set, skipping mempool configuration")
return
Expand All @@ -33,7 +33,6 @@ func (app *KiichainApp) configureEVMMempool(appOpts servertypes.AppOptions, logg
app.EVMKeeper,
app.FeeMarketKeeper,
app.txConfig,
app.clientCtx,
mempoolConfig,
cosmosPoolMaxTx,
)
Expand All @@ -53,7 +52,7 @@ func (app *KiichainApp) configureEVMMempool(appOpts servertypes.AppOptions, logg

// createMempoolConfig creates a new EVMMempoolConfig with the default configuration
// and overrides it with values from appOpts if they exist and are non-zero.
func (app *KiichainApp) createMempoolConfig(appOpts servertypes.AppOptions, logger log.Logger) *evmmempool.EVMMempoolConfig { //nolint:unused
func (app *KiichainApp) createMempoolConfig(appOpts servertypes.AppOptions, logger log.Logger) *evmmempool.EVMMempoolConfig {
return &evmmempool.EVMMempoolConfig{
AnteHandler: app.GetAnteHandler(),
LegacyPoolConfig: evmconfig.GetLegacyPoolConfig(appOpts, logger),
Expand Down
2 changes: 2 additions & 0 deletions contrib/local_node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,13 @@ if [[ $overwrite == "y" || $overwrite == "Y" ]]; then
sed -i '' 's/prometheus-retention-time = 0/prometheus-retention-time = 1000000000000/g' "$APP_TOML"
sed -i '' 's/enabled = false/enabled = true/g' "$APP_TOML"
sed -i '' 's/enable = false/enable = true/g' "$APP_TOML"
sed -i '' 's/max-txs = -1/max-txs = 0/g' "$APP_TOML"
else
sed -i 's/prometheus = false/prometheus = true/' "$CONFIG"
sed -i 's/prometheus-retention-time = "0"/prometheus-retention-time = "1000000000000"/g' "$APP_TOML"
sed -i 's/enabled = false/enabled = true/g' "$APP_TOML"
sed -i 's/enable = false/enable = true/g' "$APP_TOML"
sed -i 's/max-txs = -1/max-txs = 0/g' "$APP_TOML"
fi

# Change proposal periods to pass within a reasonable time for local testing
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ replace (
github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0

// Use our fork w/ fee abstraction possibility
github.com/cosmos/evm => github.com/KiiChain/evm v0.5.1-fork.2
github.com/cosmos/evm => github.com/KiiChain/evm v0.5.1-fork.3

// TODO: remove it: https://github.com/cosmos/cosmos-sdk/issues/13134
github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.4.2
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -705,8 +705,8 @@ github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXY
github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c/go.mod h1:X0CRv0ky0k6m906ixxpzmDRLvX58TFUKS2eePweuyxk=
github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY=
github.com/Joker/jade v1.1.3/go.mod h1:T+2WLyt7VH6Lp0TRxQrUYEs64nRc83wkMQrfeIQKduM=
github.com/KiiChain/evm v0.5.1-fork.2 h1:RdhSOFe6eXVnDxf3s1v1HR7z74w+kgHqhttOm4Vy0cc=
github.com/KiiChain/evm v0.5.1-fork.2/go.mod h1:AiKOtGMt539qICNH2Kdy+iw9yK3rlcU6MWet3+g8sWs=
github.com/KiiChain/evm v0.5.1-fork.3 h1:zGdwtaCsaj7O5/DXAZ5NK74ZDVhUzmotoUwW9mQOQKc=
github.com/KiiChain/evm v0.5.1-fork.3/go.mod h1:AiKOtGMt539qICNH2Kdy+iw9yK3rlcU6MWet3+g8sWs=
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=
github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY=
github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
Expand Down
72 changes: 36 additions & 36 deletions tests/e2e/e2e_evm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"math/big"
"net/http"
"strings"
"time"

"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
Expand Down Expand Up @@ -103,53 +104,52 @@ func (s *IntegrationTestSuite) testEVM(jsonRPC string) {
})
}

// Disabled until EVM mempool is enabled again
// // testMempoolEVM Tests EVM's mempool
// func (s *IntegrationTestSuite) testMempoolEVM(jsonRPC string) {
// var err error
// testMempoolEVM Tests EVM's mempool
func (s *IntegrationTestSuite) testMempoolEVM(jsonRPC string) {
var err error

// // Get a funded EVM account and check balance transactions
// evmAccount := s.chainA.evmAccount
// Get a funded EVM account and check balance transactions
evmAccount := s.chainA.evmAccount

// // Setup client
// client, err := ethclient.Dial(jsonRPC)
// s.Require().NoError(err)
// Setup client
client, err := ethclient.Dial(jsonRPC)
s.Require().NoError(err)

// // Get the nonce (transaction count)
// nonce, err := client.PendingNonceAt(context.Background(), evmAccount.address)
// s.Require().NoError(err)
// Get the nonce (transaction count)
nonce, err := client.PendingNonceAt(context.Background(), evmAccount.address)
s.Require().NoError(err)

// // Setup send amt
// amount := big.NewInt(1000000)
// Setup send amt
amount := big.NewInt(1000000)

// // Test Mempool
// s.Run("Testing out of order nonce", func() {
// // Send 3 Txs with nonce
// // Nonce +0
// tx, err := EVMSendWithNonce(client, evmAccount.key, evmAccount.address, s.chainB.evmAccount.address, amount, nil, nonce)
// s.Require().NoError(err)
// Test Mempool
s.Run("Testing out of order nonce", func() {
// Send 3 Txs with nonce
// Nonce +0
tx, err := EVMSendWithNonce(client, evmAccount.key, evmAccount.address, s.chainB.evmAccount.address, amount, nil, nonce)
s.Require().NoError(err)

// // Nonce +2
// tx2, err := EVMSendWithNonce(client, evmAccount.key, evmAccount.address, s.chainB.evmAccount.address, amount, nil, nonce+2)
// s.Require().NoError(err)
// Nonce +2
tx2, err := EVMSendWithNonce(client, evmAccount.key, evmAccount.address, s.chainB.evmAccount.address, amount, nil, nonce+2)
s.Require().NoError(err)

// // Wait to make sure it is in the correct ordering
// time.Sleep(time.Millisecond * 500)
// Wait to make sure it is in the correct ordering
time.Sleep(time.Millisecond * 500)

// // Nonce +1
// tx3, err := EVMSendWithNonce(client, evmAccount.key, evmAccount.address, s.chainB.evmAccount.address, amount, nil, nonce+1)
// s.Require().NoError(err)
// Nonce +1
tx3, err := EVMSendWithNonce(client, evmAccount.key, evmAccount.address, s.chainB.evmAccount.address, amount, nil, nonce+1)
s.Require().NoError(err)

// // Wait for successful first tx
// s.waitForTransaction(client, tx, evmAccount.address)
// Wait for successful first tx
s.waitForTransaction(client, tx, evmAccount.address)

// // Wait for successful third tx
// s.waitForTransaction(client, tx3, evmAccount.address)
// Wait for successful third tx
s.waitForTransaction(client, tx3, evmAccount.address)

// // Wait for successful second tx
// s.waitForTransaction(client, tx2, evmAccount.address)
// })
// }
// Wait for successful second tx
s.waitForTransaction(client, tx2, evmAccount.address)
})
}

// waitForTransaction waits until transaction is mined, requiring its success and checks reason in case of failure
func (s *IntegrationTestSuite) waitForTransaction(client *ethclient.Client, tx *geth.Transaction, sender common.Address) *geth.Receipt {
Expand Down
1 change: 1 addition & 0 deletions tests/e2e/e2e_setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,7 @@ func (s *IntegrationTestSuite) initValidatorConfigs(c *chain) {
appConfig.API.Address = "tcp://0.0.0.0:1317"
appConfig.MinGasPrices = fmt.Sprintf("%s%s", minGasPrice, akiiDenom)
appConfig.GRPC.Address = "0.0.0.0:9090"
appConfig.Mempool.MaxTxs = 0

// Setup EVM related
evmConfig := evmconfig.DefaultConfig()
Expand Down
3 changes: 1 addition & 2 deletions tests/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,7 @@ func (s *IntegrationTestSuite) TestEVM() {
jsonRPC := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("8545/tcp"))
s.testEVMQueries(jsonRPC)
s.testEVM(jsonRPC)
// Disabled until mempool bug is fixed
// s.testMempoolEVM(jsonRPC)
s.testMempoolEVM(jsonRPC)
}

// TestERC20 runs the ERC20 tests. It is skipped if the variable is set
Expand Down
Loading