Skip to content

eth_getTransactionReceipt RPC returned the reorged block hash #1068

@zjb0807

Description

@zjb0807

If the transaction block is reorged, the previous block hash will be retrieved from the cache

_getReceipt = async (txHash: string): Promise<TransactionReceipt | null> => {
const txFromCache = this.blockCache.getReceiptByHash(txHash);
if (
txFromCache &&
await this._isBlockCanonical(txFromCache.blockHash, txFromCache.blockNumber)
) {
delete txFromCache.byzantium;
return txFromCache;
}
const txFromSubql = await this.subql?.getTxReceiptByHash(txHash);
return txFromSubql
? subqlReceiptAdapter(txFromSubql)
: null;
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions