Clarify hard fork names in transaction tests
See original GitHub issueCurrently, in the TransactionTests
, multiple names are confusing:
See for instance this logic I implemented in my toy client:
/** Returns the starting block height for the given version. */
private static int blockHeight (String version) {
return switch (version) {
case "Byzantium" -> BYZANTIUM.startBlock;
case "Constantinople" -> CONSTANTINOPLE.startBlock;
case "ConstantinopleFix" -> CONSTANTINOPLE.startBlock;
case "EIP150" -> TANGERINE_WHISTLE.startBlock;
case "EIP158" -> SPURIOUS_DRAGON.startBlock; // (*)
case "Frontier" -> FRONTIER.startBlock;
case "Homestead" -> HOMESTEAD.startBlock;
case "Istanbul" -> ISTANBUL.startBlock;
default -> throw new AssertionError("unreachable");
// (*) if interpreted as EIP-161 that supersedes EIP-158
};
}
The left column are the names used in the transaction test JSON files.
- The “EIP” names should be the proper forks name, and “ConstantinopleFix” should probably be called “SaintPetersburg”.
- I think EIP158 was never actually implemented on mainnet, as it was superceded by EIP-161. I’m not sure how a client is supposed to test the “EIP158” results. Was EIP158 deployed earlier on test nets perhaps?
- Was the “Berlin” fork skipped on purpose because all results are expected to be the same? If not, is there some automated way to run the tests in a client at a Berlin block height and update the test files?
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (1 by maintainers)
Top Results From Across the Web
Clarify hard fork names in transaction tests - - Bountysource
1. The "EIP" names should be the proper forks name, and "ConstantinopleFix" should probably be called "SaintPetersburg". 2. I think EIP158 was never...
Read more >The ultimate guide to hard forks for crypto dummies
A planned hard fork means that the creators/developers were all in agreement as to how the coin would be forked. When this occurs,...
Read more >Hard Fork: What It Is in Blockchain, How It Works, Why It ...
A hard fork is a radical change to the protocol of a blockchain network that makes previously invalid blocks/transactions valid—or vice-versa.
Read more >A Guide to Bitcoin Forks and How to Claim Them ... - 99Bitcoins
A Bitcoin fork results in the creation of new forked coins. This guide explains what fork are and how to claim forked coins...
Read more >Soft fork vs. hard fork: Differences explained - Cointelegraph
A hard fork is a radical upgrade that can make previous transactions and blocks either valid or invalid and requires all validators in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
the transaction tests are being reworked. fork names identical to state tests.
Now we have some invalid transactions in state tests.
So to the other devs. But have you ever thought how those JSONs appeared initially? Its not handwritten. We used aleth implementation. Now to generate the tests I can write my own transaction implementation but that would be bad as I might make a mistake. Like ori just recently found what might be a bug in my difficulty formula on edge case.
What we need is a way to ask client if it considers certain transaction valid struct or not. But devs prefere their own tests or just ready made jsons