Skip to content
This repository has been archived by the owner on Aug 13, 2024. It is now read-only.

[KIP-114] block number is serialized to 32 bytes #152

Merged
merged 2 commits into from
Dec 26, 2023

Conversation

blukat29
Copy link
Contributor

@blukat29 blukat29 commented Nov 7, 2023

Modify KIP-114 spec's implementation detail.

  • Change block_number_to_bytes() from an 8-byte big-endian bytes to a 32-byte big-endian bytes.
  • Add a test case to check implementation correctness.
  • Change RANDOM opcode semantic to return the current block's, not latest block's.

Reason

@blukat29 blukat29 self-assigned this Nov 7, 2023
@blukat29 blukat29 changed the title kip-114: block number is serialized to 32 bytes [KIP-114] block number is serialized to 32 bytes Nov 7, 2023
@blukat29
Copy link
Contributor Author

@kjhman21 @aidan-kwon This PR is a fix to match with implementation. PTAL.

Copy link
Collaborator

@kjhman21 kjhman21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no objection for the change, but one question:

Is this required another hard fork or does it have compatibility with the previous spec?

@blukat29
Copy link
Contributor Author

@kjhman21 Klaytn v1.12.0 is already implemented in the new spec (this PR; 32-byte big-endian bytes) (https://github.com/klaytn/klaytn/blob/v1.12.0/consensus/istanbul/backend/randao_test.go#L20).

The specs before & after this PR are incompatible, but the previous spec has never been instantiated.

@blukat29 blukat29 merged commit 3b77e56 into klaytn:main Dec 26, 2023
2 checks passed
@blukat29 blukat29 deleted the kip114-num32 branch December 26, 2023 08:54
@github-actions github-actions bot locked and limited conversation to collaborators Dec 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants