LimeChain / Fruzhin

Java implementation of the Polkadot Host
Apache License 2.0
33 stars 1 forks source link

Block Production Lottery - Primary Slot #579

Closed Grigorov-Georgi closed 3 weeks ago

Grigorov-Georgi commented 1 month ago

Description

  1. The claimPrimarySlot method constructs a partial Transcript following the Polkadot specification, including the label 'BABE', slot number, current epoch, and chain randomness. The rest of the data is added through the vrfSign and makeBytes functions from the Schnorrkel library. The makeBytes function returns a byte array that is transformed from little-endian to a BigInteger. This value is then compared against an input threshold, if it is smaller, a PreDigest is intended to be returned, though it is not yet implemented.
  2. polkaj-schnorrkel jar is changed with a new one, that implements makeBytes method
  3. Two util methods are added to the LittleEndianUtils class and bytesToFixedLength is adjusted not to throw IndexOutOfBoundsException. Unit tests are added for all of these methods.

Fixes #547

sonarcloud[bot] commented 3 weeks ago

Quality Gate Passed Quality Gate passed

Issues
2 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud