-
Notifications
You must be signed in to change notification settings - Fork 759
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
Monorepo: Removal all TTD Logic from Libraries #3518
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more. |
if (typeof vm.blockchain.getTotalDifficulty !== 'function') { | ||
throw new Error('cannot get iterator head: blockchain has no getTotalDifficulty function') | ||
} |
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.
Do we still need this check?
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.
I would find it nice if we are still able to at least run ethash blockchains, and this check might be necessary for it?
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.
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.
No idea about this dev flags
…l/420/files\#diff-556d0544d517a1fe1242173c7d23c7cb5f3153bad5eeec9293865df9eefd349aR164) exchangeTransitionConfigurationV1 engine API RPC method from client
5ae8ba2
to
19df223
Compare
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.
Some small-ish comments.
The mergeForkIdTransition
: should we remove this? This is a special fork id, which specifically has to do with the PoW -> PoS transition logic which we essentially have removed here (see: https://eips.ethereum.org/EIPS/eip-3675#eip-2124-fork-identifier). Should we remove this hardfork as well? It has lead numerous times to confusion 😅 Since we don't support PoW -> PoS transition I think it is fine to remove it as well (can be done in a new PR)
Also side note: we will now thus fail any tests which have to do with PoW -> PoS transitions (there likely are not many, but there likely will be some in the ethereum/tests
and in hive)
}), | ||
'A base fee', | ||
undefined, | ||
'throws when RLP serialized block with no base fee on default hardfork (london) and setHardfork left undefined', |
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.
This test is removed but I don't think this has anything to do with TTD, so we should likely keep this in?
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.
If I interpret this test correctly, this is testing some weird half-defined case for the more-complex TD
including setHardfork
option (which we now removed).
So, now, with the surrounding test setup, both when we set setHardfork
to true
as well as false
we are going the normal ways to a minimally-London common (common provided is initialized with London
) and so this test setup should not throw in both cases (also re-tested this now).
That's why I removed the test case, should be not testing anything meaningful now.
@@ -57,122 +55,24 @@ describe('[Utils/Parse]', () => { | |||
assert.equal(params.genesis.timestamp, '0x10', 'timestamp parsed correctly') | |||
}) | |||
|
|||
it('should successfully parse kiln genesis and set forkhash', async () => { | |||
const common = createCommonFromGethGenesis(gethGenesisKilnJSON, { |
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.
I don't think this one should be removed as well? Correctly setting the hardfork order? Maybe the mergeForkIdTransition
should be removed here?
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.
I tried to re-add the two tests you mentioned, but I am getting a "Error parsing parameters file: nonzero terminal total difficulty is not supported" error now when trying to re-add the Kiln config file, so I guess this is not so easy to re-create in this setup.
I would generally pledge that there are more simple test setups for HF order as well as getHardforkBy()
functionality and this is sufficiently tested in other places and we therefore shouldn't stick to this super-outdated Kiln setup (I was somewhat happy to throw the Kiln config out) and just throw it out here.
(side mention: guess nothing urgent to ad hoc re-add, but I do wonder if we would rather want to keep the "Geth config with post-Merge transition but a dedicated Merge HF block included" case (so this would also match what we keep in other places) instead of fully throwing this out. Guess THAT case also should not produce significant overhead and still migth be useful. Again, but in doubt we can "re-add on demand" I guess).
|
||
assert.equal(common.getHardforkBy({ blockNumber: 0n }), Hardfork.London, 'london at genesis') | ||
assert.equal( | ||
common.getHardforkBy({ blockNumber: 1n, td: 2n }), |
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.
Same for this test, we can remove all checks with have to do with td
checks, but the getHardforkBy
via either block or timestamp should still work.
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.
See comment above
Let's be semantically precise here: we are only removing the Live transition from PoW -> PoS (at least that's my understanding from the basis of what we are doing and that's also what I would be suggesting), so that is this first-time transition where the fork block is not yet known and needs to be determined by TTD in a complicated manner. We still do support a static transition (post Merge PIT, merge block known), and I personally would strongly pledge to keep it this way, since the remaining logic is easy to handle and not a substantial overhead and otherwise we would e.g. finally loose on a theoretical/practical mainnet full sync capability (still dreaming of this 😂). For a static transition the Ah, and while writing about it: the subsequent fork hashes would also be wrong, so we would loose the correct fork hash calculation (since in-between HFs are calculated in into newer ones). So we should definitely keep "as is" and live with some mild technical debt here (can remember a somewhat longer discussion/thread from Martin Holst Swende where he also complained about this, that this forkk would now be "in forever", but that's just how it is now. 🙂 )
So, since |
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.
LGTM. Lets fix that bracket later.
@holgerd77 This is because we do not run certain forks on the CI, in this case that would be the fork which actually has the Merge transition. (Just like we don't run |
@jochem-brouwer ah, ok, thanks! |
Too radical? 😂
Could anyone already give this a first look, removed all TTD stuff from Commoon, lots of tests falling off the roof, but I would say: so what?
(so Common would be just a first step, this would go up the libraries then)