This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pallet-timestamp: Remove
ValidAtTimestamp
error variant (#13346)
* 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. * Update primitives/timestamp/src/lib.rs Co-authored-by: André Silva <[email protected]> * Rename to `TooEarly` * FMT --------- Co-authored-by: André Silva <[email protected]>
- Loading branch information