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 support for measures to LocalTxMonitor #1191

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

fraser-iohk
Copy link
Contributor

@fraser-iohk fraser-iohk commented Jul 26, 2024

Description

This PR fixes #1178 and builds on #1175 by adding support for arbitrary measures to the LocalTxMonitor server in ouroboros-consensus. Relevant changes to ouroboros-network are required to build these changes, since the LocalTxMonitor protocol has been changed to add a new GetMeasures message.

Remaining work required before this can be merged:

  • Consolidate TxLimits #1175 needs to be merged
  • corresponding ouroboros-network PR needs to be merged
  • version change needs to be implemented somewhere
  • clean up the commit history
  • deal with fromByteSize being very likely to silently overflow the new numeric type

@nfrisby nfrisby force-pushed the nfrisby/consolidate-txlimits branch 2 times, most recently from 3661dcc to 4ea4ab8 Compare August 25, 2024 21:41
Remove `Mempool.`getTxSize`; the snapshot interface contains sizes now.

Transaction size, block capacity, and mempool capacity are multi-dimensional
vectors (incl ExUnits, etc), instead of merely bytes: see `TxMeasure`.

A transaction cannot be added if it would push any component of the size over
that component's capacity.

The capacity override is still only specified in byte size, but the value is
interpreted as a block count (rounded up).

Enforce block capacity _before_ the forging logic.
Now the forging logic simply includes whatever transactions its given, which is
reasonable and simpler. It's the NodeKernel logic that uses the mempool's
finger tree in order to slice an appropriately-sized prefix, which is then
passed to the now-dumb forging function.

consensus: no longer need BoundedMeasure, Measure suffices

consensus-cardano: use ConwayMeasure in Babbage

TOSQUASH fixup overflow workarounds and their explanations

consensus: update stale tryAddTxs Haddock references

consensus: an editing pass on the addTx Haddock

consensus: elaborate comment on pureTryAddTx guard

consensus: mitigate new mempool DoS vector

consensus: txMeasure now fails if the tx is too big

TOSQUASH fixup hlint and 9.* build

TOSQUASH fixup stylish

TOSQUASH polishing

consensus: explicit overflow check in pureTryAddTx

consensus: Word32 for tx byte size instead of Natural

consensus: mention Segregated Witness scheme in tx byte size comment
@nfrisby nfrisby force-pushed the nfrisby/consolidate-txlimits branch from 4ea4ab8 to ee1400e Compare August 26, 2024 20:04
@nfrisby nfrisby force-pushed the nfrisby/consolidate-txlimits branch from f15f603 to a7bd1c5 Compare August 28, 2024 18:07
@fraser-iohk fraser-iohk force-pushed the fraser-iohk/localtxmonitor-measures branch from 16e7267 to 159d33f Compare September 3, 2024 12:24
@nfrisby nfrisby force-pushed the nfrisby/consolidate-txlimits branch 6 times, most recently from 6ad371d to 9c022f3 Compare September 4, 2024 13:40
Base automatically changed from nfrisby/consolidate-txlimits to main September 4, 2024 15:26
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.

Enrich LocalTxMonitor to report other tx size dimensions
2 participants