You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears to be possible to specify mempool elements that are larger than the blocks which should contain them.
The place where these come together is in the mempool creation routine cork_mempool_new_size_ex. At the very least, the problem could be diagnosed there, taking into account the need to provide both block and element headers. Possible solutions include:
Modifying the documentation to call attention to the erroneous usage. This, alone, leaves open the possibility of difficult to diagnose segmentation faults at run time. It also requires exposing the block and element structures with their otherwise invisible header / link fields.
Including a test in cork_mempool_new_size_ex that will abort the computation if the pathology occurs. If this is done, the diagnostic should specify the minimum block size required to hold a single element of the desired size.
Allowing the code to adjust the block size, if necessary, so that a block will hold at least one element with the necessary header / link fields. Note that this might be extended so that a block will always hold an integral number of elements. It is not clear that this offers other than aesthetic benefits, although, a user naively specifying a block that is an integral multiple of the user's element size ensures a, possibly significant, waste of space due to the header / link space required.
Introduce an incompatible change that replaces the block size specification with an element count specification. With this change, a default element count would replace the current default block size specification.
The text was updated successfully, but these errors were encountered:
It appears to be possible to specify mempool elements that are larger than the blocks which should contain them.
The place where these come together is in the mempool creation routine
cork_mempool_new_size_ex
. At the very least, the problem could be diagnosed there, taking into account the need to provide both block and element headers. Possible solutions include:cork_mempool_new_size_ex
that will abort the computation if the pathology occurs. If this is done, the diagnostic should specify the minimum block size required to hold a single element of the desired size.The text was updated successfully, but these errors were encountered: