Skip to content

rpc: eth_sendRawTransactionSync fast path never returns an already available receipt #23990

Description

@AskAlexSharov

eth_sendRawTransactionSync (rpc/jsonrpc/send_transaction.go:114, main at 52b071b) checks the receipt before waiting on the receipts subscription:

if receipt, err := api.GetTransactionReceipt(ctx, hash); err != nil && receipt != nil {
	return receipt, nil
}

GetTransactionReceipt never returns a receipt together with an error, so this branch never runs. A transaction that is mined before the receipts filter attaches waits for the full timeout, although eth_getTransactionReceipt already returns it.

Fix: err == nil && receipt != nil, plus a test for a transaction that is already mined when the call starts. Found in the review of #23969.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions