* Fix crash if vote state is malformed
* Fix vote program crash if clock rewinds
Return an instruction error instead of panicking if the vote
program detects the vote program's vote authority history is
newer than the current clock.
---------
Co-authored-by: Richard Patel <ripatel@jumptrading.com>
* Add new StakeError variant
* Add closure to return error if EpochRewards::active
* Use error_during_epoch_rewards for Instructions that mutate stake accounts
* Use try instead of manually matching Ok/Err
* Consolidate error_during_epoch_rewards check
* Add new test helper
* Add test demonstrating which ix return StakeError::EpochRewardsActive
* Remove single-use fn
* alt_bn128: simplify errors in sycalls (alt_bn128, compress, poseidon)
* add TODO for feature gate. remove validate from compress
* add feature gate
* fix one more error case
* all changes under feature gate
* revert removing from()
* return unexpected errors in lib
* add comment to remove error types, once the feature gate is activated
* remove unnecessary/impossible error
* fix mispelled comments
This reduces the maximum penalty for voting after the grace period by
roughly 50%. This new value was derived from looking at the effects
that TVC at max credits 8 would have for recent epochs (500+) and
noting that the effect was a bit extreme, up to and exceeding 10%
"bonus" for faster voters. This change reduces that maximum bonus by
roughly half.
In addition, the TVC feature key has been changed.
`sha2` and `sha3` crates already moved to `generic-array` 0.14.7,
which means that we can safely convert the hash result to a sized
array just by calling `finalize().into()`, which doesn't return
any errors.
The typo in the function names convert_edianness_64 and convert_edianness_128 has been corrected to convert_endianness_64 and convert_endianness_128 respectively.
* implement a custom parser for `VoteState` which is usuable in a bpf context
* derive or impl `Arbitrary` for `VoteStateVersions` and its component types, for test builds only
That new release contains an important change which prevents a
potential DDoS.
* Lightprotocol/light-poseidon#32
Invoking `from_bytes_be` function light-poseidon 0.1.1 inverts all
the inputs before performing a check whether their length exceeds
the modulus of the prime field. Therefore, it was prone to an
attack, where a mailicious user could submit long byte slices just
to DDoS the validator, being stuck on inverting large byte sequences.
The update and mentioned change fixes the same issue as #33363 aims
to address.
The new release contains also few other less important changes like:
* Lightprotocol/light-poseidon#37
* Lightprotocol/light-poseidon#38
* Lightprotocol/light-poseidon#39