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

Hotfix: Use JsonRpc provider for initial block number #3682

Merged
merged 3 commits into from
Jul 12, 2023

Conversation

timjrobinson
Copy link
Contributor

@timjrobinson timjrobinson commented Jul 12, 2023

Description

zkEVM wasn't running scripts that update on every new block because it didn't have a websocket provider and we initialize our block counter via getting the current block number from the websocket provider (we used to listen to all blocks this way which is why we used websocket provider in the first place, but then we switched to an interval to save on Alchemy costs).

Switching the provider to the normal RPC provider so blocks update on networks without a websocket provider set.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How should this be tested?

  • Ensure that block numbers are increasing via putting a breakpoint in this code on each network. Ensure the current block number is correct from the jsonRPC provider.

Checklist:

  • I have performed a self-review of my own code
  • I have requested at least 1 review (If the PR is significant enough, use best judgement here)
  • I have commented my code where relevant, particularly in hard-to-understand areas
  • If package-lock.json has changes, it was intentional.
  • The base of this PR is master if hotfix, develop if not

@vercel
Copy link

vercel bot commented Jul 12, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
beta-app-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 12, 2023 10:09am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
app-v2 ⬜️ Ignored (Inspect) Jul 12, 2023 10:09am

@timjrobinson timjrobinson changed the title Use JsonRpc provider for initial block number Hotfix: Use JsonRpc provider for initial block number Jul 12, 2023
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