Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
932 views
in Technique[技术] by (71.8m points)

solidity - Logs of a pending ethereum transaction disappeared after confirmation

When I used "eth_getLogs" to query logs of a pending transaction, the log info showed up as below, but after the tx was confirmed, the logs are not available on etherescan. This tx used the delegate call. Could anyone advise on why the logs disappeared?

log info by querying ""eth_getLogs"" when the tx is pending:

  topics: [
    '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef',
    '0x0000000000000000000000006463bd6026a2e7bfab5851b62969a92f7cca0eb6',
    '0x000000000000000000000000860bd2dba9cd475a61e6d1b45e16c365f6d78f66'
  ],
  data: '0x00000000000000000000000000000000000000000000058677bb9e53cb507ddd',
  blockNumber: '0xb117d6',
  transactionHash: '0x9b51d7093c4507fa96af3fd4418c508700cb9f69f3cea9d7f5a192afa30cd1bf',
  transactionIndex: '0x41',
  blockHash: '0x0000000000000000000000000000000000000000000000000000000000000000',
  logIndex: '0x4f',
  removed: false
}

transaction on etherscan after confirmation: https://etherscan.io/tx/0x9b51d7093c4507fa96af3fd4418c508700cb9f69f3cea9d7f5a192afa30cd1bf


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Since the results of the transaction execution, including the generated events, depend on the state of the contract and the account at the time of execution, then, apparently, the shown log corresponds to the state if the transaction were included in block 0xb117d6, but at the time of real execution in the context of block 0xb117d8, the state block / account were already different, which led to a different result.

In addition, the prediction of the execution of pending transactions is based on the data of your specific node, which, in the presence of forks, may differ from the data of the main chain.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...