Skip to content

Conversation

@jribbink
Copy link
Contributor

@jribbink jribbink commented Jan 6, 2026

Closes #2243

Description

Adds block_height pins to DM dependencies.

  • Behavioiur remains backward-compatible, however, depdedencies can now be historically backfilled on new machines/CI without requiring a manual update step.
  • Migration/block_height pins will be added after the first install after updating.
  • Post-migration flow.json is still backward-compatible with old CLI version, and will just ignore the unknown field

For contributor use:

  • Targeted PR against master branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work
  • Code follows the standards mentioned here
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

@github-actions
Copy link

github-actions bot commented Jan 6, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@codecov-commenter
Copy link

codecov-commenter commented Jan 6, 2026

Codecov Report

❌ Patch coverage is 80.18018% with 22 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/dependencymanager/dependencyinstaller.go 80.18% 16 Missing and 6 partials ⚠️

📢 Thoughts on this report? Let us know!

@jribbink jribbink force-pushed the jribbink/height-pins branch from c1e9e21 to 941d475 Compare January 7, 2026 19:15
@jribbink jribbink marked this pull request as ready for review January 7, 2026 21:58
@chasefleming chasefleming requested a review from Copilot January 7, 2026 23:31
Copy link

Copilot AI left a comment

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 adds block height pinning to Flow dependency manager, enabling reproducible dependency installation across machines and CI environments. Dependencies are now frozen to specific blockchain block heights, ensuring consistent contract versions.

Key changes:

  • Block height tracking for each dependency with automatic pinning on install
  • Historical contract retrieval using GetAccountAtBlockHeight for pinned versions
  • Backward-compatible migration (zero block heights auto-migrate to latest)
  • Spork recovery logic to handle inaccessible historical blocks

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

File Description
internal/dependencymanager/dependencyinstaller.go Implements block height caching, historical contract fetching, spork recovery, and cross-network duplicate detection
internal/dependencymanager/dependencyinstaller_test.go Comprehensive test coverage for block height pinning scenarios including new dependencies, migrations, spork recovery, and caching
go.mod Updates flowkit dependency and promotes flow-core-contracts to direct dependency
flowkit/schema.json Adds block_height and canonical fields to JSON schema for dependencies

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jribbink jribbink added the Improvement Technical work without new features, refactoring, improving tests label Jan 7, 2026
@chasefleming chasefleming self-requested a review January 8, 2026 00:59
@jribbink jribbink merged commit 8870634 into master Jan 9, 2026
9 checks passed
@jribbink jribbink deleted the jribbink/height-pins branch January 9, 2026 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Improvement Technical work without new features, refactoring, improving tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pin flow.json dependencies to block heights for historical contract availability

4 participants