-
Notifications
You must be signed in to change notification settings - Fork 212
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 BSC RPC error: "exceed maximum block range" #541
base: develop
Are you sure you want to change the base?
Conversation
indexed: true, | ||
name: 'messageId', | ||
type: 'bytes32' | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you modify this ABI?
It is a legacy ABI from the older version of AMB, where events had different signatures:
UserRequestForSignature(bytes)
instead ofUserRequestForSignature(bytes32,bytes)
UserRequestForAffirmation(bytes)
instead ofUserRequestForAffirmation(bytes32,bytes)
Since these signatures are already present in history of the production bridge, we should account for both types of events.
} | ||
}) | ||
} | ||
|
||
async function getPastEvents(contract, options) { | ||
if (MONITOR_CACHE_EVENTS !== 'true') { | ||
return commonGetPastEvents(contract, options) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to use getPastEventsWithAPIFallback
here?
url.searchParams.append('toBlock', options.toBlock || 'latest') | ||
url.searchParams.append('topic0', web3.eth.abi.encodeEventSignature(abi)) | ||
|
||
const logs = await fetch(url).then(res => res.json()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the Etherscan API docs: For performance & security considerations, only the first 1000 results are return. So please narrow down the filter parameters
.
Seems that we need to request events in batches by using some sort of pagination logic.
@LyzeOfKiel @k1rill-fedoseev what do you think if the graph on BSC is used instead of Etherscan API? |
Closes #538