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

add new SOFTFORK condition #168

Merged
merged 1 commit into from
May 30, 2023
Merged

add new SOFTFORK condition #168

merged 1 commit into from
May 30, 2023

Conversation

arvidn
Copy link
Contributor

@arvidn arvidn commented May 24, 2023

Enabling this is a hard fork, and it allows future conditions to be added as soft-forks and have non-zero cost.

The new condition is HARDFORK. The opcode is 90. It requires at least one argument, which is the cost of the condition (specified in 10 thousands). All other parameters are ignored.

In memepool-mode (NO_UNKNOWN_CONDS), any SOFTFORK condition is an error, as expected.
In consensus mode (the default), any SOFTFORK condition is silently ignored, but the cost is applied.

@arvidn arvidn force-pushed the softfork-condition branch from f11e946 to a65af7b Compare May 24, 2023 20:18
@coveralls-official
Copy link

coveralls-official bot commented May 24, 2023

Pull Request Test Coverage Report for Build 5084415251

  • 14 of 16 (87.5%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 60.824%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/gen/validation_error.rs 0 2 0.0%
Totals Coverage Status
Change from base Build 5083277513: 0.1%
Covered Lines: 812
Relevant Lines: 1335

💛 - Coveralls

@arvidn arvidn force-pushed the softfork-condition branch from a65af7b to 40c8192 Compare May 24, 2023 20:33
@arvidn arvidn marked this pull request as ready for review May 24, 2023 20:51
@arvidn arvidn requested a review from richardkiss May 24, 2023 20:52
src/gen/conditions.rs Outdated Show resolved Hide resolved
src/gen/opcodes.rs Outdated Show resolved Hide resolved
@arvidn arvidn force-pushed the softfork-condition branch from 40c8192 to fbbe29c Compare May 25, 2023 09:18
@arvidn arvidn requested a review from richardkiss May 25, 2023 09:18
…ws future conditions to be added as soft-forks and have non-zero cost
@arvidn arvidn force-pushed the softfork-condition branch from fbbe29c to f6eb447 Compare May 25, 2023 20:44
Copy link
Contributor

@richardkiss richardkiss left a comment

Choose a reason for hiding this comment

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

Looks good.

@arvidn arvidn merged commit da83fa8 into main May 30, 2023
@arvidn arvidn deleted the softfork-condition branch May 30, 2023 19:42
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.

2 participants