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

Use smaller block number - from the contract and from the RPC #314

Closed
Siegrift opened this issue May 21, 2024 · 2 comments · Fixed by #322
Closed

Use smaller block number - from the contract and from the RPC #314

Siegrift opened this issue May 21, 2024 · 2 comments · Fixed by #322
Assignees

Comments

@Siegrift
Copy link
Collaborator

Siegrift commented May 21, 2024

See thread.

There are some chains, for which the contract block number is slightly higher than the block number returned by the RPC. The problem is that when this happens, we fail to get nonce (and delay the update considerably).

We've agreed on the call to use the smaller of the block number from the contract and by the RPC. The RPC call is made after the contract call. There is a possibility of a race condition, but we will see if this turns out to be a problem in practice.

@Siegrift Siegrift assigned Siegrift and bdrhn9 and unassigned Siegrift May 22, 2024
@bdrhn9
Copy link
Contributor

bdrhn9 commented May 28, 2024

We discussed this issue with @bbenligiray, and we've decided that using the block number from the RPC call is a more elegant approach for the following reasons:

  • It helps resolve idiosyncrasies we've encountered on Arbitrum and Arbitrum-based chains.
  • It aligns with the well-accepted practice of obtaining the block number directly from the RPC call.

Regarding the order of the static call to read the active data feed batch and eth_blockNumber, a decision was necessary. Fetching the block number first and then reading the active data feed batch can create a race condition, leading to a failure to submit updates due to an expired nonce. Conversely, reading the active data feed batch first and then fetching the block number can also cause a race condition, potentially resulting in redundant update transactions. To minimize the possibility of both types of race conditions, firing both calls simultaneously looks like more proper way.

@bbenligiray
Copy link
Member

Ben pointed out that these are Arbitrum Orbit chains, i.e., Arbitrum-based L3s

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 a pull request may close this issue.

3 participants