Skip to content

fix(libs): estimated block height uses dynamic genesis - #1301

Merged
alexfreska merged 1 commit into
mainfrom
fix_libs_estimated_block_height_uses_dynamic_genesis
Dec 24, 2025
Merged

fix(libs): estimated block height uses dynamic genesis#1301
alexfreska merged 1 commit into
mainfrom
fix_libs_estimated_block_height_uses_dynamic_genesis

Conversation

@alexfreska

@alexfreska alexfreska commented Sep 3, 2025

Copy link
Copy Markdown
Member

Copilot AI review requested due to automatic review settings September 3, 2025 13:13
@changeset-bot

changeset-bot Bot commented Sep 3, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9e8a104

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

This PR includes changesets to release 10 packages
Name Type
@siafoundation/renterd-react Minor
@siafoundation/walletd-react Minor
@siafoundation/hostd-react Minor
@siafoundation/units Minor
renterd Patch
walletd Patch
hostd Patch
@siafoundation/indexd-react Patch
explorer Patch
indexd Patch

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

@vercel

vercel Bot commented Sep 3, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

5 Skipped Deployments
Project Deployment Review Updated (UTC)
explorer Ignored Ignored Preview Dec 24, 2025 0:35am
explorer-zen Ignored Ignored Preview Dec 24, 2025 0:35am
hostd Ignored Ignored Preview Dec 24, 2025 0:35am
indexd Ignored Ignored Preview Dec 24, 2025 0:35am
renterd Ignored Ignored Preview Dec 24, 2025 0:35am

@github-project-automation github-project-automation Bot moved this to In Progress in Sia Sep 3, 2025

alexfreska commented Sep 3, 2025

Copy link
Copy Markdown
Member Author

Comment thread libs/renterd-react/src/bus.ts
@alexfreska
alexfreska requested review from n8mgr and telestrial and removed request for Copilot September 3, 2025 13:15
@alexfreska
alexfreska force-pushed the fix_libs_estimated_block_height_uses_dynamic_genesis branch from 7bbbd72 to 8bda935 Compare September 3, 2025 13:15
Copilot AI review requested due to automatic review settings September 3, 2025 13:15

Copilot AI 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.

Pull Request Overview

This PR refactors the estimated block height calculation to use a dynamic genesis timestamp instead of hardcoded network-specific values. The change consolidates multiple network-specific block height functions into a single dynamic function that accepts a genesis timestamp parameter.

  • Replaces hardcoded mainnet and testnet genesis timestamps with dynamic genesis timestamp parameter
  • Consolidates getMainnetBlockHeight and getTestnetZenBlockHeight functions into getBlockHeightFromGenesis
  • Updates all consumers to use the new dynamic function with hardforkOak.genesisTimestamp

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
libs/units/src/blockHeight.ts Replaces network-specific functions with single dynamic function accepting genesis timestamp
libs/walletd-react/src/api.ts Updates to use new dynamic block height function with network genesis timestamp
libs/renterd-react/src/bus.ts Updates to use new dynamic block height function with state genesis timestamp
libs/hostd-react/src/api.ts Updates to use new dynamic block height function with state genesis timestamp
.changeset/cute-badgers-fly.md Documents the breaking change for affected packages

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread libs/units/src/blockHeight.ts Outdated
Comment thread libs/units/src/blockHeight.ts Outdated
@alexfreska
alexfreska force-pushed the fix_libs_estimated_block_height_uses_dynamic_genesis branch from 8bda935 to 5bab94b Compare September 3, 2025 15:09
Comment thread libs/indexd-react/src/admin.ts Outdated
@alexfreska
alexfreska force-pushed the fix_libs_estimated_block_height_uses_dynamic_genesis branch from 5bab94b to 094dc83 Compare September 3, 2025 15:12
@alexfreska
alexfreska marked this pull request as draft September 22, 2025 13:35
@alexfreska alexfreska moved this from In Progress to In Review in Sia Sep 22, 2025
@alexfreska

Copy link
Copy Markdown
Member Author

@n8mgr @ChrisSchinnerl not incredibly high priority but bumping this PR. Its blocked because there is no API that provides access to hardforkOak.genesisTimestamp in indexd or renterd.

@n8mgr

n8mgr commented Dec 19, 2025

Copy link
Copy Markdown
Member

@alexfreska it looks like renterd has /api/bus/consensus/network to provide it.

@alexfreska
alexfreska changed the base branch from main to graphite-base/1301 December 22, 2025 16:34
@alexfreska
alexfreska force-pushed the fix_libs_estimated_block_height_uses_dynamic_genesis branch from 094dc83 to e00bf4a Compare December 22, 2025 16:34
@alexfreska
alexfreska changed the base branch from graphite-base/1301 to feat_indexd_add_consensus_apis December 22, 2025 16:34
@alexfreska
alexfreska marked this pull request as ready for review December 22, 2025 16:35

alexfreska commented Dec 24, 2025

Copy link
Copy Markdown
Member Author

Merge activity

  • Dec 24, 12:34 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Dec 24, 12:36 AM UTC: Graphite rebased this pull request as part of a merge.
  • Dec 24, 12:46 AM UTC: @alexfreska merged this pull request with Graphite.

@alexfreska
alexfreska changed the base branch from feat_indexd_add_consensus_apis to graphite-base/1301 December 24, 2025 00:34
@alexfreska
alexfreska changed the base branch from graphite-base/1301 to main December 24, 2025 00:34
@alexfreska
alexfreska force-pushed the fix_libs_estimated_block_height_uses_dynamic_genesis branch from e00bf4a to 9e8a104 Compare December 24, 2025 00:35
@alexfreska
alexfreska merged commit 28b27ce into main Dec 24, 2025
29 of 54 checks passed
@alexfreska
alexfreska deleted the fix_libs_estimated_block_height_uses_dynamic_genesis branch December 24, 2025 00:46
@github-project-automation github-project-automation Bot moved this from In Review to Done in Sia Dec 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants