Skip to content

feat: add chain.blockTime #3702

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

Merged
merged 9 commits into from
Jun 5, 2025
Merged

feat: add chain.blockTime #3702

merged 9 commits into from
Jun 5, 2025

Conversation

jxom
Copy link
Member

@jxom jxom commented Jun 5, 2025

Chains are becoming a lot faster than Mainnet these days (OP Stack, ZKsync, etc). We should be adjusting the default polling interval/cache time to suit.

Copy link

changeset-bot bot commented Jun 5, 2025

🦋 Changeset detected

Latest commit: 99f7954

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
viem Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Jun 5, 2025

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

Name Status Preview Updated (UTC)
viem 🛑 Canceled (Inspect) Jun 5, 2025 5:11pm

Copy link

codecov bot commented Jun 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.62%. Comparing base (835b02a) to head (99f7954).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3702   +/-   ##
=======================================
  Coverage   99.62%   99.62%           
=======================================
  Files        1023     1023           
  Lines       79869    79874    +5     
  Branches     3446     3448    +2     
=======================================
+ Hits        79567    79572    +5     
  Misses        283      283           
  Partials       19       19           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

github-actions bot commented Jun 5, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
import * from 'viem' (esm) 70.35 KB (+0.12% 🔺) 1.5 s (+0.12% 🔺) 1.5 s (+50.53% 🔺) 2.9 s
const viem = require('viem') (cjs) 86.54 KB (-0.01% 🔽) 1.8 s (-0.01% 🔽) 1.1 s (-34.15% 🔽) 2.9 s
import { createClient, http } from 'viem' 4.57 KB (+0.37% 🔺) 92 ms (+0.37% 🔺) 79 ms (+161.47% 🔺) 171 ms
import * from 'viem/account-abstraction' 52.73 KB (+0.04% 🔺) 1.1 s (+0.04% 🔺) 1.1 s (+42.75% 🔺) 2.1 s
import * from 'viem/accounts' 82.32 KB (0%) 1.7 s (0%) 345 ms (-38.06% 🔽) 2 s
import { privateKeyToAccount } from 'viem/accounts' 20.71 KB (0%) 415 ms (0%) 386 ms (+61.35% 🔺) 800 ms
import { mnemonicToAccount } from 'viem/accounts' 27.07 KB (0%) 542 ms (0%) 425 ms (-14.21% 🔽) 967 ms
import * from 'viem/actions' 55.07 KB (0%) 1.2 s (0%) 1.2 s (-9.03% 🔽) 2.3 s
import { getBlockNumber } from 'viem/actions' 318 B (0%) 10 ms (0%) 6 ms (-83.2% 🔽) 16 ms
import * from 'viem/chains' 47.23 KB (+0.03% 🔺) 945 ms (+0.03% 🔺) 1.1 s (+13.55% 🔺) 2 s
import { mainnet } from 'viem/chains' 325 B (0%) 10 ms (0%) 38 ms (+1024.25% 🔺) 48 ms
import * from 'viem/chains/utils' 1.08 KB (0%) 22 ms (0%) 5 ms (-81.69% 🔽) 27 ms
import * from 'viem/ens' 47.81 KB (0%) 957 ms (0%) 464 ms (+2.8% 🔺) 1.5 s
import { getEnsAvatar } from 'viem/ens' 24.05 KB (0%) 481 ms (0%) 415 ms (-25.32% 🔽) 896 ms
import * from 'viem/siwe' 32.65 KB (0%) 653 ms (0%) 692 ms (+35.13% 🔺) 1.4 s
import { verifySiweMessage } from 'viem/siwe' 31.53 KB (0%) 631 ms (0%) 403 ms (-9.88% 🔽) 1.1 s

@jxom jxom marked this pull request as ready for review June 5, 2025 15:31
@jxom jxom merged commit b55ec5a into main Jun 5, 2025
23 of 25 checks passed
@jxom jxom deleted the jxom/chain-block-time branch June 5, 2025 16:12
@github-actions github-actions bot mentioned this pull request Jun 5, 2025
@@ -4,6 +4,7 @@ import { formatters } from './formatters.js'
import { serializers } from './serializers.js'

export const chainConfig = {
blockTime: 2_000,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
blockTime: 2_000,
blockTime: 1_000,

celo's block time is 1 second https://specs.celo.org/deployments.html?highlight=second#mainnet

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