ethereum / go-ethereum

Go implementation of the Ethereum protocol
https://geth.ethereum.org
GNU Lesser General Public License v3.0
47.1k stars 19.93k forks source link

transaction indexing is in progress #29956

Open Pman-me opened 3 months ago

Pman-me commented 3 months ago

In versions 1.14.4 and 1.14.5 in dev mode, when a transaction such as a transfer is made, the transaction hash is returned and when eth.getTransactionReceipt is called I encounter the message "Error: transaction indexing is in progress." Interestingly, this transaction is not listed among the pending transactions because when I call eth.pendingTransactions, it returns an empty list. Is this a bug?

This is the geth startup command

geth --jspath './scripts' --exec 'loadScript("send-funds.js")' --nodiscover --maxpeers 0 --dev --datadir . --port 30306 --networkid 4444 --unlock 0xFe2CcaE8462198801938A207dFdA3c65c525809d --password password.txt --authrpc.port 8546 --mine --miner.etherbase 0xFe2CcaE8462198801938A207dFdA3c65c525809 d --http --http.addr '0.0.0.0' --http. port 8545 --http.vhosts '*' --http.api admin,eth,miner,net,txpool,debug,web3 --allow-insecure-unlock --ipcpath "/sock/geth.ipc" --verbosity 4

rjl493456442 commented 2 months ago

Can you share a bit more logs?

It might be possible that your transaction indexing was still running in the background at that time.

Pman-me commented 2 months ago

Can you share a bit more logs?

It might be possible that your transaction indexing was still running in the background at that time.

geth logs or javascript console log?

Pman-me commented 2 months ago

For example, I made a transfer transaction from the first wallet to itself this info is related to transfer tx Including the transaction hash and its details and info about the latest and pending blocks and my question is why with only one transaction Is there a latest block and a pending block?

eth.sendTransaction({from: eth.accounts[0], to: eth.accounts[0], value: 100, nonce:0})
"0xb20ea7cb31365e4b3af5c3af030f66483e1209a696390bfb079af4984cc92d79"
> eth.pendingTransactions
[]
> eth.blockNumber
1
> eth.getBlock('latest')
{
  baseFeePerGas: 875000000,
  blobGasUsed: 0,
  difficulty: 0,
  excessBlobGas: 0,
  extraData: "0xd883010e05846765746888676f312e32322e34856c696e7578",
  gasLimit: 11511229,
  gasUsed: 21000,
  hash: "0x50ae32975e91943418c7b939332e08e0b3996d212153069320afb673d610dc8e",
  logsBloom: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  miner: "0x0000000000000000000000000000000000000000",
  mixHash: "0xb047683309c693e90ff426a5eebeca2a569f017b46155ca62c12073ffd195b37",
  nonce: "0x0000000000000000",
  number: 1,
  parentBeaconBlockRoot: "0x0000000000000000000000000000000000000000000000000000000000000000",
  parentHash: "0x212f446a921da64d2dccc546e9f5cddf56f15e730c34a7b5afe43267f8f37b1b",
  receiptsRoot: "0xf78dfb743fbd92ade140711c8bbc542b5e307f0ab7984eff35d751969fe57efa",
  sha3Uncles: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
  size: 719,
  stateRoot: "0xf18f7123e967710edb7c46daaca6e57e4b5b0f91da25f4427192683be09c9599",
  timestamp: 1718471574,
  totalDifficulty: 0,
  transactions: ["0xb20ea7cb31365e4b3af5c3af030f66483e1209a696390bfb079af4984cc92d79"],
  transactionsRoot: "0x0e25f9fae75f03ce266700d4dfad893f4c6a78f3c3d24e9cc0de6a06df4947a9",
  uncles: [],
  withdrawals: [],
  withdrawalsRoot: "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"
}
> eth.getBlock('pending')
{
  baseFeePerGas: 766024067,
  blobGasUsed: 0,
  difficulty: 0,
  excessBlobGas: 0,
  extraData: "0xd883010e05846765746888676f312e32322e34856c696e7578",
  gasLimit: 11522469,
  gasUsed: 0,
  hash: null,
  logsBloom: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  miner: null,
  mixHash: "0x0000000000000000000000000000000000000000000000000000000000000000",
  nonce: null,
  number: 2,
  parentHash: "0x50ae32975e91943418c7b939332e08e0b3996d212153069320afb673d610dc8e",
  receiptsRoot: "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
  sha3Uncles: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
  size: 574,
  stateRoot: "0xf18f7123e967710edb7c46daaca6e57e4b5b0f91da25f4427192683be09c9599",
  timestamp: 1718471608,
  totalDifficulty: 0,
  transactions: [],
  transactionsRoot: "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
  uncles: [],
  withdrawals: [],
  withdrawalsRoot: "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"
}
> eth.getTransactionReceipt("0xb20ea7cb31365e4b3af5c3af030f66483e1209a696390bfb079af4984cc92d79")
{
  blockHash: "0x50ae32975e91943418c7b939332e08e0b3996d212153069320afb673d610dc8e",
  blockNumber: 1,
  contractAddress: null,
  cumulativeGasUsed: 21000,
  effectiveGasPrice: 875000001,
  from: "0xfe2ccae8462198801938a207dfda3c65c525809d",
  gasUsed: 21000,
  logs: [],
  logsBloom: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  status: "0x1",
  to: "0xfe2ccae8462198801938a207dfda3c65c525809d",
  transactionHash: "0xb20ea7cb31365e4b3af5c3af030f66483e1209a696390bfb079af4984cc92d79",
  transactionIndex: 0,
  type: "0x2"
}
> 
rjl493456442 commented 2 months ago

According to the log you provide, you successfully retrieve back the receipt of 0xb20ea7cb31365e4b3af5c3af030f66483e1209a696390bfb079af4984cc92d79, isn't it?