Skip to content

fix: Calculate link t_sizes correctly#388

Open
Peeja wants to merge 6 commits intomainfrom
fix/bad-tsizes
Open

fix: Calculate link t_sizes correctly#388
Peeja wants to merge 6 commits intomainfrom
fix/bad-tsizes

Conversation

@Peeja
Copy link
Member

@Peeja Peeja commented Mar 17, 2026

This PR contains a few minor fixes and refactors, but mainly this fixes a bad t_size calculation. We ended up setting the t_size of a link to the size of the node it points to, when in fact it should be the entire DAG it points to, cumulatively up to the root.

We also had a bad calculation in the check, which this also addresses.

PR Dependency Tree

This tree was auto-generated by Charcoal

Peeja added 4 commits March 17, 2026 17:20
I don't think I actually ran into an issue here, but there's one lying
in wait.
This was nearly harmless, as "completing" with `NULL` just writes `NULL` as the CID, which is what it already was. This change fixes two things:

1. We no longer log that we completed something when we didn't.
2. We avoid a theoretical race condition where the correct CID has been written to the DB and we overwrite it with our old `NULL`. I'm not sure we even have enough concurrency for this to be a problem, but the change still feels safer.
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.

1 participant