question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Clarify hard fork names in transaction tests

See original GitHub issue

Currently, 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.

  1. The “EIP” names should be the proper forks name, and “ConstantinopleFix” should probably be called “SaintPetersburg”.
  2. 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?
  3. 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:closed
  • Created 2 years ago
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
winsvegacommented, Sep 11, 2021

the transaction tests are being reworked. fork names identical to state tests.

1reaction
winsvegacommented, Aug 6, 2021

Now we have some invalid transactions in state tests.

For me personally, just having the JSON files is useful already. Parsing them is not difficult. Maybe it doesn't fit with how this repo is used with retesteth, but that's just my perspective :)

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found