Add helper functions for slot time deadlines#4589
Conversation
|
TODO (create the following helper functions and update spec/tests to use these instead of
hi @jtraglia, creating this initial draft with one of the functions |
5b2ebc6 to
a7f141f
Compare
|
@0xYYY Yes, this look good. Please continue! |
…get_proposer_inclusion_list_cutoff_ms
|
hi @jtraglia, thanks for the comments |
|
Looks great :) |
| #### `get_attestation_due_ms` | ||
|
|
||
| ```python | ||
| def get_attestation_due_ms(epoch: Epoch) -> uint64: |
There was a problem hiding this comment.
this returns 3999 for the attestation deadline
>>> 3333 * 12000 // 10000
3999wondering if we rather wanna round to closest integer to have cleaner values
There was a problem hiding this comment.
This came up in the original PR too. We could do something like this if devs want it.
There was a problem hiding this comment.
Ah I missed that comment, I guess there isn't a need to adapt it on the spec, can just change the rounding in our code eg. can just use Math.round instead of Math.floor, the difference is negligible so it shouldn't matter either way.
This PR adds some helper functions to phase0 for getting deadlines of various slot components.
Related PR: #4542
Fixes #4586