Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

pallet-timestamp: Remove ValidAtTimestamp error variant #13346

Merged
merged 4 commits into from
Feb 14, 2023

Commits on Feb 9, 2023

  1. pallet-timestamp: Remove ValidAtTimestamp error variant

    The error variant wasn't that useful and it was also used wrongly in the code. In the code we
    returned this variant when the `timestamp < minimum`. The problem of this is that we waited on the
    node side some time, but then `set` function rejects the timestamp because of the same check (the
    timestamp in the block stays the same). We ensure that the timestamp isn't drifting too much in the
    future, but waiting for the timestamp to be "valid" would open some attack vector. The consensus
    protocols also compare the slots in the blocks to ensure that there isn't a block from the future
    and in the runtime we then ensure that `slot = timestamp / slot_duration`. So, we can just remove
    this variant and replace it with a new variant `TimeBetweenBlocksTooShort` to not even try importing
    a block which uses a too short delay since the last block.
    bkchr committed Feb 9, 2023
    Configuration menu
    Copy the full SHA
    8047698 View commit details
    Browse the repository at this point in the history

Commits on Feb 14, 2023

  1. Update primitives/timestamp/src/lib.rs

    Co-authored-by: André Silva <[email protected]>
    bkchr and andresilva authored Feb 14, 2023
    Configuration menu
    Copy the full SHA
    4d46477 View commit details
    Browse the repository at this point in the history
  2. Rename to TooEarly

    bkchr committed Feb 14, 2023
    Configuration menu
    Copy the full SHA
    75a631a View commit details
    Browse the repository at this point in the history
  3. FMT

    bkchr committed Feb 14, 2023
    Configuration menu
    Copy the full SHA
    576a2e7 View commit details
    Browse the repository at this point in the history