-
Notifications
You must be signed in to change notification settings - Fork 156
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
Clean hardfork switches #3162
Clean hardfork switches #3162
Conversation
ab049d4
to
aad1445
Compare
4981d58
to
aea58b9
Compare
aea58b9
to
b32a155
Compare
6f5510c
to
9e86252
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.
looks great, thank you @teodanciu , wonderful clean up! (my only comment is about the orig
file).
9e86252
to
bca24e6
Compare
since it was verified that removing it creates the same ledger state, proving the switch unnecessary.
bca24e6
to
fd3d310
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.
This is a great cleanup!!! Thank you.
Just one minor comment
since it was verified that removing it creates the same ledger state, proving the switch unnecessary.
since it was verified that removing it creates the same ledger state, proving the switch unnecessary.
fd3d310
to
ed690e9
Compare
Closes: #3104
Answers the question: which HardFork switches can we remove from the code without affecting the state
How I checked:
1. allowMIRTransfer pp = pvMajor (getField @"_protocolVersion" pp) > 4 ❎
Ran:
because 23068800 is the first slot in Mary (version 4) and 39916975 is the first slot in the next era
This resulted in an error:
ExtValidationErrorLedger (HardForkLedgerErrorFromEra S (S (S (Z (WrapLedgerErr {unwrapLedgerErr = BBodyError (BlockTransitionError [LedgersFailure (LedgerFailure (DelegsFailure (WithdrawalsNotInRewardsDELEGS (fromList [(RewardAcnt {getRwdNetwork = Mainnet, getRwdCred = KeyHashObj (KeyHash "7f5287ac749c44f8b517165a35ea60a0a165904b25da29749d2366e4")},Coin 220383)]))))])})))))
So I concluded it can't be removed.
2. aggregatedRewards pp = pvMajor (getField @"_protocolVersion" pp) > 2 ❎
set to True, trying to take a snapshot from 4492800 (first Shelley slot(v2)) to 16588800 (first Allegra slot (v3)) resulted in:
ExtValidationErrorLedger (HardForkLedgerErrorFromEra S (Z (WrapLedgerErr {unwrapLedgerErr = BBodyError (BlockTransitionError [LedgersFailure (LedgerFailure (DelegsFailure (WithdrawalsNotInRewardsDELEGS (fromList [(RewardAcnt {getRwdNetwork = Mainnet, getRwdCred = KeyHashObj (KeyHash "24f1b3791037e55363815fc4b788b886cd1d82a2f2d39e17196cd1a4")},Coin 431236474)]))))])})))
3. validatePoolRewardAccountNetID pp = pvMajor (getField @"_protocolVersion" pp) > 4 ❎
set to True, trying to take a snapshot from 23068800 (first Mary slot(v2)) to 39916975 (first Alonzo slot (v3)) resulted in:
ExtValidationErrorLedger (HardForkLedgerErrorFromEra S (S (S (Z (WrapLedgerErr {unwrapLedgerErr = BBodyError (BlockTransitionError [LedgersFailure (LedgerFailure (DelegsFailure (DelplFailure (PoolFailure (WrongNetworkPOOL Mainnet Testnet (KeyHash "ae8ee8f5676a3c3aadefd0ee7adb57ebbd39dd7126c8517e718dc4c1"))))))])})))))
4. forgoRewardPrefilter pp = pvMajor (getField @"_protocolVersion" pp) > 6 ❎
set to True, trying to take a snapshot from 43372972 (v6) to 76138419 resulted in:
ExtValidationErrorLedger (HardForkLedgerErrorFromEra S (S (S (S (Z (WrapLedgerErr {unwrapLedgerErr = BBodyError (BlockTransitionError [ShelleyInAlonzoPredFail (LedgersFailure (LedgerFailure (DelegsFailure (DelplFailure (DelegFailure (StakeKeyNonZeroAccountBalanceDELEG (Just (Coin 658031))))))))])}))))))
5. translateTimeForPlutusScripts pp = pvMajor (getField @"_protocolVersion" pp) > 5 ✔️
set to True, a snapshot of 76138419 (latest slot that I had synced with mainnet) was generated with the same sha256 of the snapshot taken with the switch enabled (9aafb9e44500f84d2a59dfd8019934dd42a947edf976c35d90fa6bb4136604dd )
6. allowScriptStakeCredsToEarnRewards pp = pvMajor (getField @"_protocolVersion" pp) > 4 ✔️
set to True, a snapshot of 76138419 with the original sha256 is generated
7. allowOutsideForecastTTL pp =let mv = pvMajor (getField @"_protocolVersion" pp) in mv == 5 || mv == 6 ✔️
set to True, a snapshot of 76138419 with the original sha256 is generated
8. missingScriptsSymmetricDifference ❔
I forgot why we can't switch this off even if the state is the same