Skip to content

SDK - Generator - Mass Exceed on a single utxo set evaluation round should not exit if there are other utxos that could fit #701

@IzioDev

Description

@IzioDev

Describe the bug
Under certain conditions (more below), the Generator could have picked a valid (according to KIP-9 rules) UTXO to spend according to the request conditions, but has failed while supposedly only attempting one of them.

Method: generator.next()

Input parameters:

  • payload
    636970685f6d73673a01b09eadce2f05f00289a1de1603383e2b8283bc8e74c37bed75a0ce0db369628860d5d2e6b1243f9685809f5889d0f8cab14313432b19059baa0621e6a5d8e9888415b5884e7ba44e483ebd72e089d617aab093bdeb590e38ec1b30d6bf0083f4780e0b351caab91af44d11fd85b0291fcff75b5d87445ba1709858cc89ea121b86304249e63b8311283c6fa8be683e1ee1c786629e79fd4d469634072006d3f8cdfc74b4d6732b41a76919071e4ebb488900297d757abe73fb8d6d8b012fa2a038414c6cea7a14cd2e07ad3bd9083e0b1976b0c59cb3b64566250455ab4d37562a839e1f6ee0e665b535255a233a0ade5d9205e52cc5ab6cb4fe74cb1d736c33619e1401c8e1cd75e519e138db4b7b101d509d1fbf7820a4a3223129038e1f3bc2064dae148f36dac0b4d53ab82fb1c76d2b9add63574662169cba7b30797b896f7aa1c79d9ed5c1be48112e1c2ac4ab0fe84b6194aa3c94ff4cdf6798f3c217c8
    
  • address: kaspatest:qqfxqnutdqycengg2w3ch36djg20y9ws5kyvjhzflgxw5ledzwt9ulkhlny0x (as an Address)
  • priorityFee: 0n
  • outputs: [new PaymentOutput(destinationAddress, 20000000n)] (0.2 TKAS)

UTXO Context: (sorry about the format)

{"utxos":[{"entry":{"address":{"version":"PubKey","prefix":"kaspatest","payload":"qzadn9tyvela5tc9rpn5tnrlkmdq9988wu8nh57pa4d62nw92pspsd740qlkv"},"outpoint":{"transactionId":"3017aa20bfe904407a214d81997468b8defef0617cef9007c7fa12b322a22c05","index":0},"amount":"29624618","scriptPublicKey":{"version":0,"script":"20bad99564667fda2f05186745cc7fb6da0294e7770f3bd3c1ed5ba54dc5506018ac"},"blockDaaScore":"183065193","isCoinbase":false},"outpoint":{"transactionId":"3017aa20bfe904407a214d81997468b8defef0617cef9007c7fa12b322a22c05","index":0},"address":{"version":"PubKey","prefix":"kaspatest","payload":"qzadn9tyvela5tc9rpn5tnrlkmdq9988wu8nh57pa4d62nw92pspsd740qlkv"},"amount":"29624618","isCoinbase":false,"blockDaaScore":"183065193","scriptPublicKey":{"version":0,"script":"20bad99564667fda2f05186745cc7fb6da0294e7770f3bd3c1ed5ba54dc5506018ac"}},{"entry":{"address":{"version":"PubKey","prefix":"kaspatest","payload":"qzadn9tyvela5tc9rpn5tnrlkmdq9988wu8nh57pa4d62nw92pspsd740qlkv"},"outpoint":{"transactionId":"7a973447dd13e0c1375f98e669794f87c7421f9976d54a09e1bcf8443bbe961a","index":0},"amount":"50000000","scriptPublicKey":{"version":0,"script":"20bad99564667fda2f05186745cc7fb6da0294e7770f3bd3c1ed5ba54dc5506018ac"},"blockDaaScore":"185277525","isCoinbase":false},"outpoint":{"transactionId":"7a973447dd13e0c1375f98e669794f87c7421f9976d54a09e1bcf8443bbe961a","index":0},"address":{"version":"PubKey","prefix":"kaspatest","payload":"qzadn9tyvela5tc9rpn5tnrlkmdq9988wu8nh57pa4d62nw92pspsd740qlkv"},"amount":"50000000","isCoinbase":false,"blockDaaScore":"185277525","scriptPublicKey":{"version":0,"script":"20bad99564667fda2f05186745cc7fb6da0294e7770f3bd3c1ed5ba54dc5506018ac"}}]}

To make it simpler, here are the UTXO:
Image

console error: Storage mass exceeds maximum

Expected behavior
Generator should potentially fail on the utxo that has 0.29624618 TKAS but should eventually try another combination for the request, in this case the utxo that has 0.5 TKAS.

SDK Information

  • wasm web kaspa v1.0.0, taken from built wasm package on the releases page.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions