Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: trace_filter matches all transactions on empty addresses #5279

Merged
merged 4 commits into from
Nov 3, 2023
Merged

fix: trace_filter matches all transactions on empty addresses #5279

merged 4 commits into from
Nov 3, 2023

Conversation

phillipleblanc
Copy link
Contributor

@phillipleblanc phillipleblanc commented Nov 3, 2023

ref: #4799

The default behavior for trace_filter in Erigon when neither fromAddress nor toAddress are specified, is to match and return all transactions in the block range.

This PR modifies the trace_filter implementation in Reth to match all transactions when neither address filter is specified.

This payload returns transactions from Erigon, but an empty array in Reth: (This is a Goerli block)

curl --request POST \
  --url 'http://localhost:8545' \
  --header 'Content-Type: application/json' \
  --data '{
	"method": "trace_filter",
	"params": [
		{
			"fromBlock": "0x983323",
			"toBlock": "0x983323"
		}
	],
	"id": 1,
	"jsonrpc": "2.0"
}'

Response from reth:

{
	"jsonrpc": "2.0",
	"result": [],
	"id": 1
}

Response from Erigon:

{
	"jsonrpc": "2.0",
	"id": 1,
	"result": [
		{
			"action": {
				"from": "0x24eaeb92580ca9a1a40e6d0148b13551f3f43855",
				"callType": "call",
				"gas": "0x2127c",
				"input": "0xfd4312be000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000040a3ec4fc70eaf64faf6eeda4e9b2bd4742a785464053aa23afad8bd24650e86ffba01d52a7cd84480d0573725899486a0b5e55c20ff45d6628874349375d165029ac1828383d596ba6b9c874c97f3dae8b203252c2de2fa9ec809dabb4995932fef8132823c3ac25abf2126d6030ba0dd95564834b498fa7005f7c43e8b105510000000000000000000000000000000000000000000000000000000000000002000000000000000000000000edb40d000000000000000000000000001bc69880000000000000000000000002501ccf8000000000000000000000000000a7af58",
				"to": "0xf9bff8167c96ffcb86b506c008227b800cfa867e",
				"value": "0x0"
			}, 
	-- snipped for brevity
}

@phillipleblanc phillipleblanc changed the title trace_filter matches all transactions on empty addresses fix: trace_filter matches all transactions on empty addresses Nov 3, 2023
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, tysm!

@mattsse mattsse added this pull request to the merge queue Nov 3, 2023
Merged via the queue into paradigmxyz:main with commit ddcd4d6 Nov 3, 2023
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants