Skip to content
This repository has been archived by the owner on Jan 15, 2022. It is now read-only.

txSponsor overhaul

Latest
Compare
Choose a tag to compare
@kalepail kalepail released this 13 Apr 16:04
37bb26a

Just made a pretty key and breaking change around txSponsors. There's currently a pretty good gotcha in that each txSponsor can only ever have one pending txFunctionFee. Reason being if you ever have more than one as soon as one is submitted the rest will contain outdated sequence numbers.

This requires then each txFunction to have their own txSponsor and then each Turret to also have their own txSponsor so a 3 of 6 scenario with 3 service txFunctions would need to be ready with 6 * 3 = a lot of txSponsors.

I've just pushed an update that will solve for at least the service side by allowing you to associate what txFunctions a txSponsor can sign for from it's one pending txFunctionFee.

When you call POST /tx-sponsors along with the txSponsorFee also include a txFunctions array including all the hashes of the txFunctions in your service.

{
    "txFunctions": [
        "fffcf41be32ff2582475fc19341bdfbbfcc5852364ef510422bef0eb02850f17",
        "dfd66d5e44ba78d76725aa32111f00870cd7e1718226a540fc38914b7b82a8a4",
        "ae0b2ff7cb05e1420bb3f13af3fc52ad0dd84a1be4ef4e42dcc1a960b7c24ad4",
        "2cb2cd09c5a6b85b524b94dbeb0adeaad2094b3456c36a16c454f3a8744c0892",
        "0b859a9b24cf6986563ed0e96493d3eb90eee58466c28827e2d037848c194fb5"
    ],
    "txSponsorFee": "AAAAAgAAAADnIJuzYT8MC0Kpo9WiygcXRILWCMsY3Q8Fkwg2gaEnOAAAAGQAAxdrAAAABgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAA//89BvjL/JYJHX8GTQb37v8xYUjZO9RBCK+8OsChQ8XAAAAAQAAAAAAAAABAAAAAHjsM/OE0yi61zuStQL6QnUG8R6XjCSfjDWrMDuw6N7QAAAAAAAAAAAF9eEAAAAAAAAAAAGBoSc4AAAAQG/CS68ipwelSvcQMquQVKhr5dnRSAIjYzy4/AAIKIHMIHOdNvdUgwyNe7IOEXSgtwo2CQiciS6uoq01R2T2HwE="
}
{
    "status": "OK",
    "memoHash": "57566a1d0174cb2f65b5fc47961a178865a2ab12f7101c925c3ef31c99cadd4b",
    "sponsor": "GDTSBG5TME7QYC2CVGR5LIWKA4LUJAWWBDFRRXIPAWJQQNUBUETTQKNQ"
}

The memoHash is then what you'll use instead of the txFunction hash when generating txFunctionFees for the memo.hash.

You can then use that same txFunctionFee for any txFunction in the txFunctions array from when you upserted the txSponsor.

You'll still need a unique txSponsorFee per Turret but I think that's fine.

I’ve also added fee bump support to allow for paying the sequence number separate from the fee payment or just for bumping the original txFunctionFee in the case of base fee increases or surge pricing. To use a fee bumped txFunctionFee use a txFunctionFeeBump key in place of txFunctionFee on txFunction runs.