Skip to content

Conversation

@ntallar
Copy link

@ntallar ntallar commented Oct 27, 2020

Description

Fixes how extra fields from blocks are generated after ECIP1097 activation.

Proposed Solution

We were currently not considering ECIP1097 (checkpoiting) when generating blocks, so they were still generated with HefECIP1098 (treasury), and no checkpoint field then. This made all post ECIP1097 blocks generated to marked as invalid.

Scenario that failed

Configure Mantis with:

  • Mocked mining on
  • ECIP1098 block number: 5
  • ECIP1097 block number: 10

Start and mine more than 10 blocks, on develop, the block 10 generated would fail

Testing

  • Unit tests added to block generator
  • Follow the scenario described above, it should no longer fail

@ntallar ntallar added the bug Something isn't working label Oct 27, 2020
@ntallar ntallar force-pushed the fix/non-checkpoint-blocks-invalid branch from b9be290 to 3bafa64 Compare October 28, 2020 12:54
@ntallar ntallar changed the title [Fix] Non checkpoint blocks after ECIP1098 should have HefPostEcip1097 extra fields [Fix] Non checkpoint blocks after ECIP1097 should have HefPostEcip1097 extra fields Oct 28, 2020
@ntallar ntallar marked this pull request as ready for review October 28, 2020 13:03
@ntallar ntallar requested review from pslaski and rtkaczyk October 28, 2020 13:07
Copy link
Contributor

@pslaski pslaski left a comment

Choose a reason for hiding this comment

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

I tried the scenario when isECIP1097 is activated, but not isECIP1098 and mocked mined block is not passing a validation. The problem is validateExtraFields method which assumes that isECIP1097 is always activated with isECIP1098

@ntallar
Copy link
Author

ntallar commented Oct 28, 2020

For now ECIP1098 has to always be activated before ECIP1097 and we are assuming for now that that will be the behaviour on any testnet used, as was described here: #709

I'll add a comment on the ECIPs configuration on that assumption

@ntallar ntallar merged commit 663f0b8 into develop Oct 29, 2020
@ntallar ntallar deleted the fix/non-checkpoint-blocks-invalid branch October 29, 2020 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants