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

support explicit filtering of txs when preparing to mine #3318

Closed

Conversation

antiochp
Copy link
Member

@antiochp antiochp commented May 4, 2020

This PR adds functionality to explicitly filter txs (by bucket) when preparing a set of candidate transaction to mine a block.

We now explicitly filter by kernel variant, allowing buckets containing transactions with the following feature variants (and only these feature variants) -

  • Plain
  • HeightLocked

HF3 will introduce the following new kernel variant (unsupported prior to HF3) -

  • NoRecentDuplicate

When we introduce the proposed NoRecentDuplicate kernel variant in HF3 we will use this new filtering logic to explicitly start allowing txs containing NoRecentDuplicate kernels to be included in a candidate block to be mined.

TODO -

Later buckets can be dependent on earlier buckets due to fee calcs.

  • So we need to hook into the "reject" logic earlier to filter out invalid txs and their dependent txs.

Actually tx_filter closure can be used on the way in to the txpool also. The filtering logic is the same.

  • Use tx_filter on way in to txpool/stempool also.

so we can filter them by kernel feature variant
@lehnberg lehnberg mentioned this pull request May 4, 2020
13 tasks
@antiochp
Copy link
Member Author

antiochp commented May 7, 2020

Jumping through a lot of hoops here to resolve a theoretical edge case where the txpool is in invalid state (contains NRD kernel prior to HF3 due to rewind).

When "preparing a block to mine" we verify the block will indeed be valid and in the unlikely case it is invalid we already fallback to mining an empty block.
So all this hoop jumping is not actually necessary.

Closing.

@antiochp antiochp closed this May 7, 2020
@antiochp antiochp deleted the bucket_txs_explicit_variants branch May 7, 2020 17:10
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.

1 participant