Closed trinhdn2 closed 10 months ago
Getting receipts via RPC API has been fixed by the merged PR https://github.com/BuildOnViction/tomochain/pull/422. Now whenever we retrieve a receipt, the node will execute the types.DeriveFields
function to overwrite the correct blockHash
in event logs and many other fields before returning the correct receipt to clients.
Getting receipts via RPC API can be fixed by the PR https://github.com/BuildOnViction/tomochain/pull/425 by correcting the blockHash
in logs
of ResultProcessBlock
without affecting the consensus. This logs
field contains event logs for websocket to fire to its subscribers.
type ResultProcessBlock struct {
logs []*types.Log
receipts []*types.Receipt
state *state.StateDB
tradingState *tradingstate.TradingStateDB
lendingState *lendingstate.LendingStateDB
proctime time.Duration
usedGas uint64
}
When we're trying to get a transaction receipt via
eth_getTransactionReceipt
API, for exampleThe
blockHash
is correct in the transaction object but in the logs it is incorrectIn the above extract, the
blockHash
that is a member of transaction is correct, but in the logs theblockHash
is incorrect, although theblockNumber
is correct. The same problem appears when subscibing websocket for new emitted event logs. There are many transaction receipts are affected from this issue.