Skip to content

Conversation

@PoulavBhowmick03
Copy link
Contributor

Issue Addressed

Fixes #8054

}
InboundEvent::Msg(DelayColumnReconstruction(request)) => {
let mut reconstruction_delay = QUEUED_RECONSTRUCTION_DELAY;
let slot_duration = self.slot_clock.slot_duration().as_millis() as f64;
Copy link
Member

Choose a reason for hiding this comment

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

We avoid doing any float arithmetic due to rounding issues and general flakiness. Integer arithmetic in milliseconds would be my preference

Copy link
Member

Choose a reason for hiding this comment

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

yep, might be worth adding this preference to CLAUDE.md too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We avoid doing any float arithmetic due to rounding issues and general flakiness. Integer arithmetic in milliseconds would be my preference

got it. will make that change

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We avoid doing any float arithmetic due to rounding issues and general flakiness. Integer arithmetic in milliseconds would be my preference

in that case, i was initially having RECONSTRUCTION_DEADLINE as a fraction (1/4) and then multiplying the slot_duration in millis with the numerator and denominator of the same. should i keep that approach?

let reconstruction_deadline_millis =
                    (slot_duration_millis * RECONSTRUCTION_DEADLINE.0)
                        / RECONSTRUCTION_DEADLINE.1;
                let reconstruction_deadline = Duration::from_millis(reconstruction_deadline_millis);

Copy link
Member

@eserilev eserilev Sep 21, 2025

Choose a reason for hiding this comment

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

I think the simplest is probably something like slot_duration_ms * reconstruction_deadline / 100. Or just divide by 4. Seems a bit unnecessary to multiply by one

@michaelsproul michaelsproul added the waiting-on-author The reviewer has suggested changes and awaits thier implementation. label Sep 17, 2025
@jimmygchen jimmygchen added ready-for-review The code is ready for review das Data Availability Sampling and removed waiting-on-author The reviewer has suggested changes and awaits thier implementation. labels Oct 16, 2025
Copy link
Member

@eserilev eserilev left a comment

Choose a reason for hiding this comment

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

Not the biggest fan of the tuple "fraction" but I think this fine and we need it for the upcoming release. Once we merge this #7944 we may be able use similar logic to calculate the max reconstruction deadline and clean this up a bit

Copy link
Member

@michaelsproul michaelsproul left a comment

Choose a reason for hiding this comment

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

Looks good to me, but we should test on some live networks to make sure this behaves as expected (could merge to unstable first I guess)

@jimmygchen jimmygchen added v8.0.0 Q4 2025 Fusaka Mainnet Release ready-for-merge This PR is ready to merge. and removed ready-for-review The code is ready for review labels Oct 17, 2025
@mergify mergify bot added the queued label Oct 17, 2025
mergify bot added a commit that referenced this pull request Oct 17, 2025
@jimmygchen jimmygchen mentioned this pull request Oct 17, 2025
7 tasks
@mergify mergify bot merged commit 79716f6 into sigp:unstable Oct 17, 2025
37 checks passed
@mergify mergify bot removed the queued label Oct 17, 2025
(slot_duration * RECONSTRUCTION_DEADLINE.0) / RECONSTRUCTION_DEADLINE.1;
let reconstruction_deadline = Duration::from_millis(reconstruction_deadline_millis);
if let Some(seconds_from_current_slot) =
self.slot_clock.seconds_from_current_slot_start()
Copy link
Member

Choose a reason for hiding this comment

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

This function only gives us granuarity to the seconds I believe

.map(|duration_into_slot| {
Duration::from_secs(duration_into_slot.as_secs() % self.slot_duration().as_secs())
})

So on a network like gnosis (5s slot times), reconstruction is only triggered immediately if seconds_from_current_slot_start is 2s

mergify bot pushed a commit that referenced this pull request Oct 21, 2025
…adline (#8246)

This recent PR below changes the max reconstruction delay to be a function of slot time. However it uses `seconds_from_slot_start` when comparing (and dropping `nano`), so it might delay reconstruction on networks where the slot time isn’t a multiple of 4, e.g. on gnosis this only happens at 2s instead of 1.25s.:
- #8067 (comment)


  Use `millis_from_slot_start` when comparing against reconstruction deadline

Also added some tests for reconstruction delay.


Co-Authored-By: Jimmy Chen <[email protected]>
jchavarri pushed a commit to jchavarri/lighthouse that referenced this pull request Oct 21, 2025
jchavarri pushed a commit to jchavarri/lighthouse that referenced this pull request Oct 21, 2025
…adline (sigp#8246)

This recent PR below changes the max reconstruction delay to be a function of slot time. However it uses `seconds_from_slot_start` when comparing (and dropping `nano`), so it might delay reconstruction on networks where the slot time isn’t a multiple of 4, e.g. on gnosis this only happens at 2s instead of 1.25s.:
- sigp#8067 (comment)


  Use `millis_from_slot_start` when comparing against reconstruction deadline

Also added some tests for reconstruction delay.


Co-Authored-By: Jimmy Chen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

das Data Availability Sampling ready-for-merge This PR is ready to merge. v8.0.0 Q4 2025 Fusaka Mainnet Release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants