-
Notifications
You must be signed in to change notification settings - Fork 132
universe+tapdb: add new block_height
field to universe_leaves
use that to implement block height based supply tree queries
#1596
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
Open
Roasbeef
wants to merge
6
commits into
supply-commit-machine
Choose a base branch
from
supply-leaf-height-query
base: supply-commit-machine
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffranr
reviewed
Jun 13, 2025
Comment on lines
+599
to
+611
// SupplyUpdate is a struct that holds a supply update event and its block | ||
// height. | ||
type SupplyUpdate struct { | ||
supplycommit.SupplyUpdateEvent | ||
BlockHeight uint32 | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
supplycommit.SupplyUpdateEvent
already includes
// BlockHeight returns the block height of the update.
BlockHeight() uint32
so I don't think we need the separate BlockHeight uint32
field in SupplyUpdate
.
3e7ed65
to
c57d19d
Compare
c2c394f
to
b1173b9
Compare
c57d19d
to
bd5d0b4
Compare
b1173b9
to
c6f9962
Compare
bd5d0b4
to
37f23fa
Compare
c6f9962
to
da0df38
Compare
37f23fa
to
be0a52c
Compare
ee045a1
to
598067d
Compare
be0a52c
to
f2a69aa
Compare
@Roasbeef, remember to re-request review from reviewers when ready |
f2a69aa
to
93ed469
Compare
598067d
to
9f03d81
Compare
93ed469
to
633373a
Compare
9f03d81
to
e77d0cf
Compare
633373a
to
3ca1517
Compare
e77d0cf
to
3044a87
Compare
3ca1517
to
988837b
Compare
3044a87
to
9854971
Compare
In this commit, we add a migratino to add a block_height to the universe leaf table. We'll use this in the future to be able to allow clinets to sync block by block for the new supply universe trees.
In this commit, we add a new method to the SupplyTreeStore that is able to read out the leaves of a supply tree based on a start and end height. This will be useful for writing the new syncing state machine and the sub-system that serves the supply tree syncer.
988837b
to
a9ef139
Compare
9854971
to
37bdcfa
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In this PR, we add a new method
FetchSupplyLeavesByHeight
, that can be used to query for the leaves of a supply tree by height. This will be useful for writing the new syncing state machine and the sub-system that serves the supply tree syncer. Such a syncer would start from the initially created pre-commitment, then fetch all the leaves for the future updates, assemble those into the supply tree, then verify that everything matches up.Prompts used during development (aider+Gemini 2.5-pro-06-5)
Initial draft creation
Based on by working memory of this new feature, I scanned the relevant files, then made mental nodes of what needed to be updated. I then drafted this fairly detailed prompt that guided
aider
w.r.t which files to update, and the set of high level changes to make.Subsequent iterations
From here I made an edit or two to get things compiling. Then I executed a series of prompts to refine the code, refactor slightly, then add unit tests.
I messed when committing and dropped a commit entirely (lol), so I had
aider
re-add it: