-
Notifications
You must be signed in to change notification settings - Fork 1
Support msec timestamp and 500 epoch length in BEP520 #54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements BEP520 support by updating the timestamp format to use millisecond precision and changing the epoch length from 200 to 500.
- Updated logging and state extraction to convert timestamps using a new MilliTimestamp helper.
- Adjusted test expectations and constants to accommodate the new 500-block epoch length and modified turnLength parameters.
- Made related updates in CI configurations and docker-compose files to reflect the new epoch length and branch requirements.
Reviewed Changes
Copilot reviewed 14 out of 18 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tool/testdata/internal/create_client.go | Converts epoch hash outputs from module.MakeEpochHash to a common.Hash |
| tests/prover_network_test.go | Updates expected timestamp value using MilliTimestamp |
| module/vote_test.go | Adjusts expected vote attestation values to new block and signature logic |
| module/validator_set_test.go | Changes expected turnLength value from 1 to 6 |
| module/setup_test.go | Revises header query tests and expected block numbers based on new epoch |
| module/prover.go | Switches timestamp conversion to MilliTimestamp |
| module/lib_test.go | Updates RLP strings for various header functions |
| module/header_query_test.go | Adjust test configurations for header queries based on updated epochs |
| module/header.go | Introduces MilliTimestamp to compute msec timestamps using MixDigest |
| module/constant/production.go | Updates BlocksPerEpoch constant from 200 to 500 |
| module/constant/development.go | Removes development override for BlocksPerEpoch |
| e2e/chains/bsc/docker-compose.simple.yml | Removes BLOCKS_PER_EPOCH override from environment variables |
| e2e/chains/bsc/docker-compose.bsc.yml | Changes branch checkout from v1.5.5 to develop |
| .github/workflows/ci.yml | Increases wait time in CI to accommodate the new epoch length |
Files not reviewed (4)
- e2e/Makefile: Language not supported
- e2e/chains/bsc/genesis/genesis-template.template: Language not supported
- e2e/chains/bsc/scripts/bootstrap.sh: Language not supported
- go.mod: Language not supported
Comments suppressed due to low confidence (3)
module/header.go:76
- [nitpick] Consider adding documentation or inline comments to clarify the assumption that the lower 64 bits of MixDigest represent the millisecond remainder. This will help maintainers understand the logic for converting the header's timestamp into millisecond precision.
func MilliTimestamp(h *types.Header) uint64 {
.github/workflows/ci.yml:60
- [nitpick] The increased sleep duration (1500 seconds) for waiting for 1000 blocks may significantly extend the CI build time. Verify that this delay is necessary or consider alternative strategies to avoid potential timeouts in the pipeline.
sleep 1500
module/setup_test.go:167
- The accompanying comment states 'checkpoint = 18' while the expected block number is 1517. Please verify that the expected header number is correct given the new turnLength and epoch configuration.
ts.Require().Equal(int64(1517), target.Number.Int64())
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
NonStop from Pascal to Lorentz HF
https://github.com/bnb-chain/BEPs/blob/master/BEPs/BEP-520.md