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

[bug] EVMIndexer discrepancy during tx search (eth_getTransactionByHash) #2029

Open
1 task
Unique-Divine opened this issue Sep 11, 2024 · 0 comments
Open
1 task
Labels
x: evm Relates to Nibiru EVM or the EVM Module

Comments

@Unique-Divine
Copy link
Member

Problem

While writing some tests for further Ethereum JSON-RPC coverage in the
"eth/rpc/rpcapi" directory, where an EVM transaction was successfully executed
with its txHash usable to retrieve the tx using "eth_getTransationReceipt".

import (
	"github.com/ethereum/go-ethereum/ethclient"
	"github.com/NibiruChain/nibiru/v2/eth/rpc/rpcapi"
)

type Suite struct {
	ethClient *ethclient.Client // Import from geth based on Ethereum defaults
	ethAPI    *rpcapi.EthAPI    // Nibiru implementation
}


txHash, err := s.ethAPI.SendRawTransaction(txBz)
s.Require().NoError(err)
_ = s.network.WaitForNextBlock()

txReceipt, err := s.ethClient.TransactionReceipt(blankCtx, txHash)
s.Require().NoError(err)
s.NotNil(txReceipt)

txHashFromReceipt := txReceipt.TxHash
s.Equal(txHash, txHashFromReceipt)

// 🚨🚨 Requesting with the same tx hash fails with "ethAPI" but succeeds with "ethClient".
tx, isPending, err := s.ethClient.TransactionByHash(blankCtx, txHash)
s.NoError(err)
s.NotNil(tx)
txJson, err := s.ethAPI.GetTransactionByHash(txHash)
// ...

Ammendment - Date: 2024-09-11

If this test is done on a live node where the EVMIndexer is disabled, and you
query eth_getTransactionByHash from JS (ethers) with default settings, the TX
is returned successfully.

"But if I modify the config app.toml to enable-indexer = true, tx search
fails"
Takeaway: The EVM Indexer is not working properly.

Likely, it's not wired properly or enabled correctly on node start.

Possible Solution(s)

  • Add testnetwork integration tests that perform sanity check operations on the indexer. We need to verify that the indexer service starts properly and that CRUD works as transactions go through.

Version

A v2 pre-release

@github-project-automation github-project-automation bot moved this to ⚡ Building 🧱 in ⚛️ Nibiru (Hougyoku) Sep 11, 2024
@github-actions github-actions bot added the S-triage Status: This issue is waiting on initial triage. More Info: https://tinyurl.com/25uty9w5 label Sep 11, 2024
@Unique-Divine Unique-Divine added x: evm Relates to Nibiru EVM or the EVM Module S-triage Status: This issue is waiting on initial triage. More Info: https://tinyurl.com/25uty9w5 and removed S-triage Status: This issue is waiting on initial triage. More Info: https://tinyurl.com/25uty9w5 x: evm Relates to Nibiru EVM or the EVM Module labels Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
x: evm Relates to Nibiru EVM or the EVM Module
Projects
Status: ⚡ Building 🧱
Development

No branches or pull requests

1 participant