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

ethclient: fix inconsistency between ethclient and WatchOpts #30438

Closed
wants to merge 1 commit into from

Conversation

xprotocol-bot
Copy link

to be consistent with accounts/abi/bind/base.go:85

which is at accounts/abi/bind/base.go:85
@karalabe
Copy link
Member

Unsure we can change this, since it's API behavior. cc @fjl

@fjl
Copy link
Contributor

fjl commented Sep 16, 2024

The mapping of nil = genesis for fromBlock is a design choice. It doesnt make sense to use nil = latest for fromBlock because it will yield empty results.

@karalabe karalabe closed this Sep 17, 2024
@xprotocol-bot
Copy link
Author

Hey!

So the issue was that for wss://base-sepolia-rpc.publicnode.com, they don't allow subscribing for more than 5000 blocks. So having genesis block as fromBlock parameter when watchOpts.Start is nil prevent me from using that RPC.

On the another hand, if someone wants to query from genesis block, the person can query by setting fromBlock=new(big.Int).SetUint64(0). Maybe we need another filter to query for the last n blocks.

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.

3 participants