Commit Graph

10 Commits

Author SHA1 Message Date
Andrew Jackson (Ajax)
3c4e22ff0c gen fix 2023-11-13 17:59:34 -06:00
Steven Allen
784214ae05
feat: sync: validate (early) that blocks fall within range (#10691)
This will reject blocks in pubsub validation if they're either:

1. Too far into the future (5 blocks beyond the expected head).
2. Too far into the past (before finality with respect to our current
   head).

Specifically:

1. We were previously rejecting future blocks in the sync logic, but not
   in pubsub itself.
2. We never used to check if a block was too _old_.

Motivation: Blocks that are too new/too old can cause us to perform
quite a bit of unnecessary work.
2023-04-22 10:15:31 -07:00
Steven Allen
141c020b4e fix: remove pointless panic
Technically, the block validator caught this panic. But it's pointless
because we have a _real_ mechanism to return the validation reason,
which we should have been using.

In general, panicing like this is a very bad idea because it's
non-obvious and, in this case, completely undocumented.
2023-04-18 15:44:56 -07:00
Alfonso de la Rocha
9bfb73211e fixed RewardFunc 2022-10-13 16:43:02 +02:00
Alfonso de la Rocha
c3ee957cc6 rm signature fns from cns iface 2022-10-13 16:30:25 +02:00
Alfonso de la Rocha
536600c95c added comments to consensus interface 2022-10-13 16:30:25 +02:00
Alfonso de la Rocha
627d6e70a6 parametrized reward function for consensus 2022-10-13 16:30:14 +02:00
Alfonso de la Rocha
5626c69ce5 wip: abstract common fns required for consensus 2022-10-13 16:28:45 +02:00
Łukasz Magiera
e65fae28de chore: fix imports 2022-06-14 17:00:51 +02:00
Łukasz Magiera
95b128b7bc chain: Cleanup consensus logic 2021-09-02 18:09:37 +02:00