Skip to content
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

Remove irrelevant height branching after FCC #1324

Closed
wants to merge 7 commits into from

Conversation

prasannavl
Copy link
Member

/kind chore

  • Remove the unnecessary condition since FCC has kicked in.

@Mixa84
Copy link
Contributor

Mixa84 commented Jun 10, 2022

This shouldn't be removed from consensus as it is possible to modify prefork state (for example from bad snapshot or etc.).

The only fork checks that are safe to remove after hardfork kicks in is from RPC and part that are not in consensus!

@prasannavl
Copy link
Member Author

prasannavl commented Jun 22, 2022

How so? The mainnet does not have these TXs. Corrupt snapshot are exactly that - corrupt (different network/fork). It's irrelevant. It's just dead code and extra branches, that's unnecessary to maintain.

It is being intentionally removed. A bug prevented valid TXs from going in there. Now the bug is fixed. While it seems like a retroactive fix, it is not, since the mainnet TXs are already done. If someone launches a new network, it's bug-free (while the current network is still compatible)

TL;DR - There's no value in keeping these code branches.

if (height >= static_cast<uint32_t>(consensus.FortCanningCrunchHeight)) {
CalculateOwnerRewards(obj.owner);
}
CalculateOwnerRewards(obj.owner);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to remain guarded. Otherwise full sync nodes will end up with some accounts that performed a FutureSwap before FCC having a higher balance than others which could lead to consensus issues.

Copy link
Member Author

@prasannavl prasannavl Aug 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But each action that does require a balance in consensus (except for this bug), should already be expected to do
CalculateOwnerRewards before such an action anyway?

Is there anything else I'm missing - otherwise, let's just do a confirmation anyway with full a sync and proceed to remove?

@prasannavl prasannavl removed the 2.9.0 label Jun 25, 2022
@Bushstar Bushstar closed this Nov 11, 2022
@prasannavl prasannavl deleted the pvl/remove-cond branch April 10, 2023 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants