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

Comparing pay-to-reemission trees by proposition #1728

Merged
merged 3 commits into from Jun 8, 2022
Merged

Comparing pay-to-reemission trees by proposition #1728

merged 3 commits into from Jun 8, 2022

Conversation

kushti
Copy link
Member

@kushti kushti commented Jun 3, 2022

This PR fixes #1726 :

There's a consensus-level disagreement affecting testnet (only). As pay-to-reemission tree is switched to v1 in 78a8bfc (merged into 4.0.29), and comparison is done over the trees during transaction validation, 4.0.29+ and prior versions currently disagree on transactions burning re-emission tokens (while paying to pay-to-reemission outputs).

As a solution, we now compare trees by propositions. Done for the testnet only, in the mainnet, to avoid disagreement with older versions, we compare trees as before.

out.ergoTree == payToReemissionContract
} else {
out.ergoTree.toProposition(true) == payToReemissionContract.toProposition(true)
}
Copy link
Member

Choose a reason for hiding this comment

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

could you please describe, why the original comparison out.ergoTree == payToReemissionContract won't affect mainnet?
Also, shoudn't testnet also have protocol upgrades to be on par with mainnet?

Copy link
Member Author

Choose a reason for hiding this comment

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

The testnet was activated with old clients, issuing and accepting (the most important part) v0 transactions burning re-emission tokens while sending ERGs to pay-to-reemission outputs. Such transactions appeared in block #206,155. Mainnet has no such transactions in the mainnet (and they could be problematic after EIP-27 activation only).

To be on par, we need for testnet relaunch at this point.

@kushti kushti changed the base branch from master to v4.0.32 June 8, 2022 09:31
@kushti kushti merged commit 2b748f0 into v4.0.32 Jun 8, 2022
@kushti kushti deleted the i1726 branch June 8, 2022 09:32
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.

Split in testnet between 4.0.29+ and prior versions
3 participants