nimbus-eth2/beacon_chain
Jacek Sieka 805e85e1ff
time: spring cleaning (#3262)
Time in the beacon chain is expressed relative to the genesis time -
this PR creates a `beacon_time` module that collects helpers and
utilities for dealing the time units - the new module does not deal with
actual wall time (that's remains in `beacon_clock`).

Collecting the time related stuff in one place makes it easier to find,
avoids some circular imports and allows more easily identifying the code
actually needs wall time to operate.

* move genesis-time-related functionality into `spec/beacon_time`
* avoid using `chronos.Duration` for time differences - it does not
support negative values (such as when something happens earlier than it
should)
* saturate conversions between `FAR_FUTURE_XXX`, so as to avoid
overflows
* fix delay reporting in validator client so it uses the expected
deadline of the slot, not "closest wall slot"
* simplify looping over the slots of an epoch
* `compute_start_slot_at_epoch` -> `start_slot`
* `compute_epoch_at_slot` -> `epoch`

A follow-up PR will (likely) introduce saturating arithmetic for the
time units - this is merely code moves, renames and fixing of small
bugs.
2022-01-11 11:01:54 +01:00
..
consensus_object_pools time: spring cleaning (#3262) 2022-01-11 11:01:54 +01:00
eth1 better web3monitor error message (#3260) 2022-01-08 14:35:36 +01:00
fork_choice time: spring cleaning (#3262) 2022-01-11 11:01:54 +01:00
gossip_processing time: spring cleaning (#3262) 2022-01-11 11:01:54 +01:00
networking Harden CommitteeIndex, SubnetId, SyncSubcommitteeIndex (#3259) 2022-01-09 01:28:49 +02:00
rpc time: spring cleaning (#3262) 2022-01-11 11:01:54 +01:00
spec time: spring cleaning (#3262) 2022-01-11 11:01:54 +01:00
sync time: spring cleaning (#3262) 2022-01-11 11:01:54 +01:00
validator_client time: spring cleaning (#3262) 2022-01-11 11:01:54 +01:00
validators time: spring cleaning (#3262) 2022-01-11 11:01:54 +01:00
.editorconfig Add .editorconfig file and remove trailing newlines 2021-09-14 12:12:49 +03:00
.gitignore Rename binaries; Mimic the original repo layout in the distribution 2020-11-09 11:38:52 +02:00
beacon_chain_db.nim update 10 modules from using merge to bellatrix (#3257) 2022-01-07 18:10:40 +01:00
beacon_chain_db_immutable.nim update 10 modules from using merge to bellatrix (#3257) 2022-01-07 18:10:40 +01:00
beacon_clock.nim time: spring cleaning (#3262) 2022-01-11 11:01:54 +01:00
beacon_node.nim Implement #3129 (Optimized history traversals in the REST API) (#3219) 2022-01-05 15:49:10 +01:00
beacon_node_status.nim EH cleanup (#2455) 2021-03-26 07:52:01 +01:00
conf.nim Implement #3129 (Optimized history traversals in the REST API) (#3219) 2022-01-05 15:49:10 +01:00
extras.nim use ForkedHashedBeaconState in StateData (#2634) 2021-06-11 20:51:46 +03:00
filepath.nim EH cleanup (#2455) 2021-03-26 07:52:01 +01:00
interop.nim bump `nim-stint` (#2969) 2021-10-14 14:13:51 +03:00
nim.cfg Revert writing backfill root to database (#3215) 2021-12-21 11:40:14 +01:00
nimbus_beacon_node.nim time: spring cleaning (#3262) 2022-01-11 11:01:54 +01:00
nimbus_beacon_node.nim.cfg Revert writing backfill root to database (#3215) 2021-12-21 11:40:14 +01:00
nimbus_binary_common.nim time: spring cleaning (#3262) 2022-01-11 11:01:54 +01:00
nimbus_signing_node.nim Implementation of the Keymanager API (BETA) 2022-01-04 18:51:45 +02:00
nimbus_signing_node.nim.cfg Revert writing backfill root to database (#3215) 2021-12-21 11:40:14 +01:00
nimbus_validator_client.nim time: spring cleaning (#3262) 2022-01-11 11:01:54 +01:00
nimbus_validator_client.nim.cfg Revert writing backfill root to database (#3215) 2021-12-21 11:40:14 +01:00
sszdump.nim ncli_db: add putState, putBlock (#3096) 2021-11-18 13:02:43 +01:00
statediff.nim time: spring cleaning (#3262) 2022-01-11 11:01:54 +01:00
statusbar.nim switch result = foo to expression return; unexport rest of logtrace symbols (#2788) 2021-08-17 09:51:39 +00:00
version.nim Support more content-types when specifying the Graffiti string 2022-01-06 10:56:59 +02:00