-
Notifications
You must be signed in to change notification settings - Fork 29
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
feat: support custom seconds per slot and slots per epoch #97
base: main
Are you sure you want to change the base?
feat: support custom seconds per slot and slots per epoch #97
Conversation
@@ -20,6 +20,7 @@ def process_future_blocks_proposal( | |||
our_pubkeys: set[str], | |||
slot: int, | |||
is_new_epoch: bool, | |||
slots_per_epoch: int = NB_SLOT_PER_EPOCH, |
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.
nit: It'd be better to not default to something here and unconditionally use the value from the spec ; happy to do a pass on top of your PR to force this parameter :)
@@ -29,6 +29,7 @@ def process_suboptimal_attestations( | |||
block: Block, | |||
slot: int, | |||
our_active_validators_index_to_validator: dict[int, Validators.DataItem.Validator], | |||
slots_per_epoch: int = NB_SLOT_PER_EPOCH, |
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.
nit: ditto
next_slot = int((time() - genesis_time_sec) / NB_SECOND_PER_SLOT) + 1 | ||
def slots( | ||
genesis_time_sec: int, | ||
seconds_per_slot: int = NB_SECOND_PER_SLOT, |
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.
nit: ditto
Thanks a lot for your contribution and sorry for the delay on this review; happy to help with the comments / help moving this forward :) |
Just a quick update here, I'm revamping part of the watcher in #93 ; part of it introduces a configuration file and the seconds_per_slots will be configurable |
Just a quick note here: next version of the watcher (beta) polls the slot time from the ethereum specs of the beacon, so it will adapt. |
Load
SLOTS_PER_EPOCH
andSECONDS_PER_SLOT
specification params from Beacon API instead of using constants. This change gives support for Gnosis Chain based networks.