-
Notifications
You must be signed in to change notification settings - Fork 431
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
[Cancun]{Spec} Goerli config and fix for ChainSpecBasedSpecProvider
#6409
Changes from 4 commits
26efbad
dc80827
e2105c1
9fb3350
20a7951
6d67c69
aab7910
3fb6a30
5e2f532
ae088c3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -107,8 +107,9 @@ public void Fork_id_and_hash_as_expected_with_merge_fork_id(long head, ulong hea | |
[TestCase(4_600_000L, 0ul, "0x757a1c47", 5_062_605ul, "Future Berlin block")] | ||
[TestCase(5_062_605L, 0ul, "0xB8C6299D", 1678832736ul, "First London block")] | ||
[TestCase(6_000_000, 0ul, "0xB8C6299D", 1678832736ul, "Future London block")] | ||
[TestCase(6_000_001, 1678832736ul, "0xf9843abf", 0ul, "First Shanghai timestamp")] | ||
[TestCase(6_000_001, 2678832736ul, "0xf9843abf", 0ul, "Future Shanghai timestamp")] | ||
[TestCase(6_000_001, 1678832736ul, "0xf9843abf", 1705473120ul, "First Shanghai timestamp")] | ||
[TestCase(6_000_001, 1705473119ul, "0xf9843abf", 1705473120ul, "Future Shanghai timestamp")] | ||
[TestCase(6_000_001, 1705473120ul, "0x70cc14e2", 0ul, "First Cancun timestamp")] | ||
public void Fork_id_and_hash_as_expected_on_goerli(long head, ulong headTimestamp, string forkHashHex, ulong next, string description) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cosmetic: add future Cancun |
||
{ | ||
Test(head, headTimestamp, KnownHashes.GoerliGenesis, forkHashHex, next, description, GoerliSpecProvider.Instance, "goerli.json"); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -126,7 +126,7 @@ private static (ForkActivation, ReleaseSpec Spec)[] CreateTransitions( | |
|
||
foreach (ulong releaseStartTimestamp in transitionTimestamps) | ||
{ | ||
long activationBlockNumber = biggestBlockTransition; | ||
long activationBlockNumber = ++biggestBlockTransition; | ||
ForkActivation forkActivation = (activationBlockNumber, releaseStartTimestamp); | ||
ReleaseSpec releaseSpec = CreateReleaseSpec(chainSpec, activationBlockNumber, releaseStartTimestamp); | ||
transitions[index++] = (forkActivation, releaseSpec); | ||
|
@@ -149,7 +149,7 @@ private static ForkActivation[] CreateTransitionActivations(SortedSet<long> tran | |
|
||
foreach (ulong timestamp in transitionTimestamps) | ||
{ | ||
transitionActivations[index++] = new ForkActivation(biggestBlockTransition, timestamp); | ||
transitionActivations[index++] = new ForkActivation(++biggestBlockTransition, timestamp); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because our GetSpec method usies binary search. And sometimes when the blocknumber only fork and timestamp gork has the same blocknumber it takes the timestamp one onstead of the blocknumber one There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you provide a more detailed explanation with examples? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if you remove the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah and it fails on... london test :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed 2nd There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @smartprogrammer93 isn't a test issue assumption issue? we can assume in tests that London and Shangai will have different block numbers and don't touch the code |
||
} | ||
|
||
return transitionActivations; | ||
|
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.
4788 address is hardcoded, so we can remove this