-
Notifications
You must be signed in to change notification settings - Fork 45
feat: update the exposed hardfork API to match Hardhat's definition #1645
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
Open
anaPerezGhiglia
wants to merge
11
commits into
main
Choose a base branch
from
feat/1634-update-exposed-hardfork-type
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
e9bdd1d
refactor(edr_chain_l1): remove unsupported pre-Byzantium hardforks fr…
Wodann e3f152b
change Hardfork constants to match HH definition
anaPerezGhiglia 58768cb
drop hardfork names form TS API
anaPerezGhiglia 22db772
rename NAPI SpecId -> L1Hardfork
anaPerezGhiglia ea9309f
Patch Hardhat tests with breaking changes
anaPerezGhiglia a8bd545
Fix HH-test after pre-byzantium hardforks removal
anaPerezGhiglia aefe459
Fix op-chain script after OpHardfork changes
anaPerezGhiglia 595bb46
Fix failing issue_588 test
anaPerezGhiglia 5841337
Adjust changeset wording
anaPerezGhiglia ef78b21
Apply PR review feedback
anaPerezGhiglia da7670b
Merge branch 'main' into feat/1634-update-exposed-hardfork-type
anaPerezGhiglia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| "@nomicfoundation/edr": minor | ||
| --- | ||
|
|
||
| - Added `L1Hardfork` enum, with all post-Byzantium L1 hardforks. Discriminants of the variants match those of `SpecId`. | ||
| - Fixed an issue for forked blockchains where a block that precedes its oldest supported hardfork was silently accepted. Now it fails with an error naming the oldest supported hardfork. | ||
| - BREAKING CHANGE: Removed `SpecId`. Instead, use `L1Hardfork`. Using any of the pre-Byzantium hardforks (`Frontier`, `FrontierThawing`, `Homestead`, `DaoFork`, `Tangerine` and `SpuriousDragon`) previously resulted in a runtime error. Now, they are no longer representable. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| "@nomicfoundation/edr": minor | ||
| --- | ||
|
|
||
| - Changed the hardfork name strings to match Hardhat's definitions: names are now camelCase (e.g. `"byzantium"`, `"muirGlacier"`, `"bedrock"`). `l1HardforkToString`/`opHardforkToString` return the new names, and `l1HardforkFromString`/`opHardforkFromString` and provider configs accept only them — passing an old-style name (e.g. `"Byzantium"`) fails. | ||
| - BREAKING CHANGE: Removed hardfork name string constants (`BYZANTIUM`, …, `AMSTERDAM` and `BEDROCK`, …, `ISTHMUS`). Instead, obtain them using `l1HardforkToString` (e.g. replace `OSAKA` with `l1HardforkToString(L1Hardfork.Osaka)`). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Now that we support
DisplayforHardforkT, can this use theDisplayinstead of theDebugtrait implementation?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.
Not so easily. To use
Displayhere we'd have to add aDisplaybound forHardforkTgeneric type of this enum, and since this error nests intoProviderError, the bound ripples through every generic consumer that renders provider errors.Containing that ripple means adding
Displayto theProtocolHardforkumbrella trait itself, which I think goes against the style guide from #1618: error-formatting bounds belong at usage sites.So I'd keep
Debugformatting here, unless we want to deliberately declareDisplaypart ofProtocolHardfork's contract.