hubble-contracts icon indicating copy to clipboard operation
hubble-contracts copied to clipboard

Only consider fees of MAX_TXS_PER_COMMIT txns when prioritizing what to pack

Open jacque006 opened this issue 3 years ago • 1 comments

See https://github.com/thehubbleproject/hubble-contracts/pull/621#discussion_r670416099

Problem

Currently, when determining the next token to pack, the value of all pending tokens in a queue is considered even though only 32 (MAX_TXS_PER_COMMIT) of them will e packed into a commitment https://github.com/thehubbleproject/hubble-contracts/blob/master/ts/client/txPool.ts#L156-L158

Solution

  • Only evaluate the 32 (MAX_TXS_PER_COMMIT) txns for a token with the highest fees when considering what to pack.
  • Consider updating feeReceivers to have a container class as well https://github.com/thehubbleproject/hubble-contracts/pull/621#discussion_r670400914

jacque006 avatar Jul 16 '21 17:07 jacque006

For "...feeReceivers to have a container class", consider using https://github.com/thehubbleproject/hubble-contracts/blob/master/ts/client/tokenbase.ts

jacque006 avatar Jul 26 '21 21:07 jacque006