Skip to content

feat: 2s blocktime - #1435

Merged
cl0w5 merged 83 commits into
masterfrom
2s
Aug 20, 2026
Merged

feat: 2s blocktime#1435
cl0w5 merged 83 commits into
masterfrom
2s

Conversation

@cl0w5

@cl0w5 cl0w5 commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Updates Hydration from 6-second to 2-second block production while preserving existing wall-clock behavior where required.

This includes runtime and node configuration changes, recalibrated per-block parameters, and migrations for active block-number-based state.

Checklist

  • runtime (general)
  • tests
  • node
  • frontier
  • system
  • scheduler + migration
  • OpenGov + migrations
  • pallet-parameters + shared 2s transition block
  • pallet-circuit-breaker + migration
  • deposit limits
  • pallet-dca + migration
  • pallet-dynamic-fees + migration
  • pallet-ema-oracle
  • pallet-liquidity-mining
  • pallet-stableswap + migration
  • pallet-staking
  • pallet-gigahdx
  • weights
  • script for removing votes by TC

Migrations

The migrations below are designed to fit in a single block. Migrations that iterate over storage contain hard caps sized above the current mainnet entry counts.

  • hydradx_runtime::migrations::parameters::SetTwoSecBlocksSince
    • Stores the transition block once in pallet-parameters.
    • Staking and GigaHDX access it through a shared Get<BlockNumber> provider.
  • pallet_dca::migrations::MultiplySchedulesPeriodBy3
  • hydradx_runtime::migrations::circuit_breaker::MigrateCircuitBreakerTo2sBlocks
    • Migrates per-asset limits and active lockdown state.
  • hydradx_runtime::migrations::dynamic_fees::MigrateDynamicFeeDecayTo2sBlocks
  • hydradx_runtime::migrations::stableswap::MigrateStableswapMaxPegUpdateTo2sBlocks
  • hydradx_runtime::migrations::scheduler::MigrateSchedulerTo2sBlocks
    • Drains the existing agenda before inserting migrated entries to avoid key collisions.
  • hydradx_runtime::migrations::referenda::MigrateReferendaTo2sBlocks
  • hydradx_runtime::migrations::conviction_voting::MigrateConvictionVotingTo2sBlocks

Try runtime

[2026-08-15T11:12:10Z INFO  hydradx_runtime::migrations::parameters] SetTwoSecBlocksSince set transition block to: 13625889
[2026-08-15T11:12:10Z INFO  pallet_dca::migrations] MultiplySchedulesPeriodBy3 found schedules: 35, processing cap: 150
[2026-08-15T11:12:10Z INFO  pallet_dca::migrations] MultiplySchedulesPeriodBy3 processed schedules: 35
[2026-08-15T11:12:10Z INFO  hydradx_runtime::migrations::circuit_breaker] MigrateCircuitBreakerTo2sBlocks found entries - trade: 0, add liquidity: 3, remove liquidity: 0, lockdown states: 54
[2026-08-15T11:12:10Z INFO  hydradx_runtime::migrations::circuit_breaker] MigrateCircuitBreakerTo2sBlocks migrated trade: 0, add liquidity: 3, remove liquidity: 0, lockdown states: 54
[2026-08-15T11:12:10Z INFO  hydradx_runtime::migrations::dynamic_fees] MigrateDynamicFeeDecayTo2sBlocks found asset fee configurations: 0, cap: 100
[2026-08-15T11:12:10Z INFO  hydradx_runtime::migrations::dynamic_fees] MigrateDynamicFeeDecayTo2sBlocks checked configurations: 0, migrated dynamic configurations: 0
[2026-08-15T11:12:10Z INFO  hydradx_runtime::migrations::stableswap] MigrateStableswapMaxPegUpdateTo2sBlocks found PoolPegs entries: 9, cap: 22
[2026-08-15T11:12:10Z INFO  hydradx_runtime::migrations::stableswap] MigrateStableswapMaxPegUpdateTo2sBlocks checked pools: 9, migrated: 9
[2026-08-15T11:12:10Z INFO  hydradx_runtime::migrations::scheduler] MigrateSchedulerTo2sBlocks found Agenda entries: 467, cap: 611
[2026-08-15T11:12:10Z INFO  hydradx_runtime::migrations::scheduler] MigrateSchedulerTo2sBlocks processed agenda items: 467
[2026-08-15T11:12:10Z INFO  hydradx_runtime::migrations::referenda] MigrateReferendaTo2sBlocks found ReferendumInfoFor records: 382, records cap: 492, ongoing: 0, ongoing cap: 10
[2026-08-15T11:12:10Z INFO  hydradx_runtime::migrations::referenda] MigrateReferendaTo2sBlocks checked referenda records: 382, ongoing: 0, migrated ongoing: 0
[2026-08-15T11:12:10Z INFO  hydradx_runtime::migrations::conviction_voting] MigrateConvictionVotingTo2sBlocks found VotingFor records: 8984, cap: 11656
[2026-08-15T11:12:10Z INFO  hydradx_runtime::migrations::conviction_voting] MigrateConvictionVotingTo2sBlocks migrated prior locks: 1331

[2026-08-15T11:12:13Z INFO  try-runtime::cli] PoV size (zstd-compressed compact proof): 175.9 KiB. For parachains, it's your responsibility to verify that a PoV of this size fits within any relaychain constraints.
[2026-08-15T11:12:13Z INFO  try-runtime::cli] Consumed ref_time: 0.72506166s (48.34% of max 1.5s)
[2026-08-15T11:12:13Z INFO  try-runtime::cli] ✅ No weight safety issues detected. Please note this does not guarantee a successful runtime upgrade. Always test your runtime upgrade with recent state, and ensure that the weight usage of your migrations will not drastically differ between testing and actual on-chain execution.

@github-actions

github-actions Bot commented Apr 30, 2026

Copy link
Copy Markdown

Crate versions that have been updated:

  • runtime-integration-tests: v1.107.1 -> v1.108.0
  • hydra-dx-math: v13.2.2 -> v13.2.3
  • hydradx: v15.2.0 -> v15.3.0
  • pallet-dca: v1.19.0 -> v1.20.0
  • pallet-dispenser: v0.4.0 -> v0.4.1
  • pallet-ema-oracle: v1.12.0 -> v1.13.0
  • pallet-gigahdx: v1.2.0 -> v1.3.0
  • pallet-gigahdx-rewards: v1.1.1 -> v1.2.0
  • pallet-lbp: v4.13.0 -> v4.14.0
  • pallet-parameters: v1.2.0 -> v1.3.0
  • pallet-staking: v5.1.0 -> v5.2.0
  • primitives: v6.4.0 -> v6.4.1
  • hydradx-runtime: v439.0.0 -> v440.0.0
  • hydradx-traits: v4.11.0 -> v4.12.0

Runtime version has been increased.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

Claude Code Review is paused for this repository. To reconnect it, an admin of this repository's GitHub organization (or the account owner, for personal repositories) who can also manage your Claude organization's Code Review settings needs to re-link GitHub in Code Review settings. This is a one-time step.

Tip: disable this comment in your organization's Code Review settings.

Comment thread runtime/hydradx/src/assets.rs Outdated
pub const StakingPalletId: PalletId = PalletId(*b"staking#");
pub const MinStake: Balance = 1_000 * UNITS;
pub const PeriodLength: BlockNumber = 7_200; // 1d based on 12s blocks, pallet accounts for migration to 6s blocks
pub const PeriodLength: BlockNumber = 7_200; // 1d based on 12s blocks, pallet accounts for migrations to 6s / 2s blocks

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

note that this period is based on relay block time

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

Claude Code Review is paused for this repository. To reconnect it, an admin of this repository's GitHub organization (or the account owner, for personal repositories) who can also manage your Claude organization's Code Review settings needs to re-link GitHub in Code Review settings. This is a one-time step.

Tip: disable this comment in your organization's Code Review settings.

@cl0w5

cl0w5 commented Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

verified migrations on testnet:

  • Runtime changed from spec version 439 to 440.
  • Blocks are produced approximately every 2 seconds.
  • parameters.twoSecBlocksSince == U.
  • All seven migration markers exist and equal 0x01:
    • HydrationTwoSecBlocksSinceMigrationDone
    • HydrationCircuitBreaker2sMigrationDone
    • HydrationDynamicFees2sMigrationDone
    • HydrationStableswapPegUpdate2sMigrationDone
    • HydrationScheduler2sBlockMigrationDone
    • HydrationReferenda2sBlockMigrationDone
    • HydrationConvictionVoting2sBlockMigrationDone
  • DCA storage version changed from 2 to 3.
  • Existing DCAs execute at approximately the same wall-clock frequency.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

Claude Code Review is paused for this repository. To reconnect it, an admin of this repository's GitHub organization (or the account owner, for personal repositories) who can also manage your Claude organization's Code Review settings needs to re-link GitHub in Code Review settings. This is a one-time step.

Tip: disable this comment in your organization's Code Review settings.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

Claude Code Review is paused for this repository. To reconnect it, an admin of this repository's GitHub organization (or the account owner, for personal repositories) who can also manage your Claude organization's Code Review settings needs to re-link GitHub in Code Review settings. This is a one-time step.

Tip: disable this comment in your organization's Code Review settings.

@github-actions

Copy link
Copy Markdown

Quick benchmark at commit b1bb18b has been executed successfully.
View results

@cl0w5
cl0w5 enabled auto-merge August 20, 2026 09:06
@cl0w5
cl0w5 merged commit 672e02f into master Aug 20, 2026
10 of 11 checks passed

@mrq1911 mrq1911 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

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