-
Notifications
You must be signed in to change notification settings - Fork 87
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
Registering script stake keys doesn't seem to do anything #1757
Comments
Hey @twwu123 thanks for reporting this! |
We are building the transaction in Mesh, the same registering process works fine in preprod testnet. Txbuilding part should have no issue as we testing with hydra minting and unlocking tx, which are working fine. In detail, it is how it looks like: Registeringconst registerCert = async (
rewardAddress: string, // Reward address of an always succeed script (stakexxxxxxxxx)
ownerUtxo: UTxO,
collateralUtxo: UTxO
) => {
const txBuilder = new MeshTxBuilder();
const txHex = await txBuilder
.protocolParams(HYDRA_PROTOCOL_PARAMETER)
.setNetwork(HYDRA_COST_MODELS)
.txInCollateral(
collateralUtxo.input.txHash,
collateralUtxo.input.outputIndex,
collateralUtxo.output.amount,
collateralUtxo.output.address
)
.txIn(
ownerUtxo.input.txHash,
ownerUtxo.input.outputIndex,
ownerUtxo.output.amount,
ownerUtxo.output.address,
0
)
.txOut(ownerUtxo.output.address, ownerUtxo.output.amount)
.registerStakeCertificate(rewardAddress)
.changeAddress(ownerUtxo.output.address)
.complete();
return txHex;
}; Withdrawalconst withdrawZero = async (
rewardAddress: string, // Reward address of an always succeed script (stakexxxxxxxxx)
scriptCbor: string, // Always succeed script
ownerUtxo: UTxO,
collateralUtxo: UTxO
) => {
const txBuilder = new MeshTxBuilder();
const txHex = await txBuilder
.protocolParams(HYDRA_PROTOCOL_PARAMETER)
.setNetwork(HYDRA_COST_MODELS)
.withdrawalPlutusScriptV3()
.withdrawal(rewardAddress, "0")
.withdrawalScript(scriptCbor)
.withdrawalRedeemerValue("")
.changeAddress(ownerUtxo.output.address)
.txInCollateral(
collateralUtxo.input.txHash,
collateralUtxo.input.outputIndex,
collateralUtxo.output.amount,
collateralUtxo.output.address
)
.complete();
return txHex;
}; Protocol Paramsexport const HYDRA_PROTOCOL_PARAMETER: Protocol = {
epoch: 0,
coinsPerUtxoSize: 0, // changed
priceMem: 0.0, // changed
priceStep: 0.0, // changed
minFeeA: 0, // changed
minFeeB: 0, // changed
keyDeposit: 0, // changed
// maxTxSize: 16_384_000, // changed
// maxTxSize: 16_384_000_000, // changed
maxTxSize: 4_294_967_295, // changed
maxValSize: 5000,
poolDeposit: 0,
maxCollateralInputs: 3,
decentralisation: 0,
// maxBlockSize: 98304,
maxBlockSize: 98_304_000, // changed
collateralPercent: 150,
maxBlockHeaderSize: 1100,
minPoolCost: "170000000",
// maxTxExMem: "16000000",
// maxTxExSteps: "10000000000",
// maxBlockExMem: "80000000",
// maxBlockExSteps: "40000000000",
maxTxExMem: "16000000000", // changed
maxTxExSteps: "10000000000000", // changed
maxBlockExMem: "80000000000", // changed
maxBlockExSteps: "40000000000000", // changed
minFeeRefScriptCostPerByte: 0,
};
export const HYDRA_COST_MODELS = [
[
100788, 420, 1, 1, 1000, 173, 0, 1, 1000, 59957, 4, 1, 11183, 32, 201305,
8356, 4, 16000, 100, 16000, 100, 16000, 100, 16000, 100, 16000, 100, 16000,
100, 100, 100, 16000, 100, 94375, 32, 132994, 32, 61462, 4, 72010, 178, 0,
1, 22151, 32, 91189, 769, 4, 2, 85848, 228465, 122, 0, 1, 1, 1000, 42921, 4,
2, 24548, 29498, 38, 1, 898148, 27279, 1, 51775, 558, 1, 39184, 1000, 60594,
1, 141895, 32, 83150, 32, 15299, 32, 76049, 1, 13169, 4, 22100, 10, 28999,
74, 1, 28999, 74, 1, 43285, 552, 1, 44749, 541, 1, 33852, 32, 68246, 32,
72362, 32, 7243, 32, 7391, 32, 11546, 32, 85848, 228465, 122, 0, 1, 1,
90434, 519, 0, 1, 74433, 32, 85848, 228465, 122, 0, 1, 1, 85848, 228465,
122, 0, 1, 1, 270652, 22588, 4, 1457325, 64566, 4, 20467, 1, 4, 0, 141992,
32, 100788, 420, 1, 1, 81663, 32, 59498, 32, 20142, 32, 24588, 32, 20744,
32, 25933, 32, 24623, 32, 53384111, 14333, 10,
],
[
100788, 420, 1, 1, 1000, 173, 0, 1, 1000, 59957, 4, 1, 11183, 32, 201305,
8356, 4, 16000, 100, 16000, 100, 16000, 100, 16000, 100, 16000, 100, 16000,
100, 100, 100, 16000, 100, 94375, 32, 132994, 32, 61462, 4, 72010, 178, 0,
1, 22151, 32, 91189, 769, 4, 2, 85848, 228465, 122, 0, 1, 1, 1000, 42921, 4,
2, 24548, 29498, 38, 1, 898148, 27279, 1, 51775, 558, 1, 39184, 1000, 60594,
1, 141895, 32, 83150, 32, 15299, 32, 76049, 1, 13169, 4, 22100, 10, 28999,
74, 1, 28999, 74, 1, 43285, 552, 1, 44749, 541, 1, 33852, 32, 68246, 32,
72362, 32, 7243, 32, 7391, 32, 11546, 32, 85848, 228465, 122, 0, 1, 1,
90434, 519, 0, 1, 74433, 32, 85848, 228465, 122, 0, 1, 1, 85848, 228465,
122, 0, 1, 1, 955506, 213312, 0, 2, 270652, 22588, 4, 1457325, 64566, 4,
20467, 1, 4, 0, 141992, 32, 100788, 420, 1, 1, 81663, 32, 59498, 32, 20142,
32, 24588, 32, 20744, 32, 25933, 32, 24623, 32, 43053543, 10, 53384111,
14333, 10, 43574283, 26308, 10,
],
[
100788, 420, 1, 1, 1000, 173, 0, 1, 1000, 59957, 4, 1, 11183, 32, 201305,
8356, 4, 16000, 100, 16000, 100, 16000, 100, 16000, 100, 16000, 100, 16000,
100, 100, 100, 16000, 100, 94375, 32, 132994, 32, 61462, 4, 72010, 178, 0,
1, 22151, 32, 91189, 769, 4, 2, 85848, 123203, 7305, -900, 1716, 549, 57,
85848, 0, 1, 1, 1000, 42921, 4, 2, 24548, 29498, 38, 1, 898148, 27279, 1,
51775, 558, 1, 39184, 1000, 60594, 1, 141895, 32, 83150, 32, 15299, 32,
76049, 1, 13169, 4, 22100, 10, 28999, 74, 1, 28999, 74, 1, 43285, 552, 1,
44749, 541, 1, 33852, 32, 68246, 32, 72362, 32, 7243, 32, 7391, 32, 11546,
32, 85848, 123203, 7305, -900, 1716, 549, 57, 85848, 0, 1, 90434, 519, 0, 1,
74433, 32, 85848, 123203, 7305, -900, 1716, 549, 57, 85848, 0, 1, 1, 85848,
123203, 7305, -900, 1716, 549, 57, 85848, 0, 1, 955506, 213312, 0, 2,
270652, 22588, 4, 1457325, 64566, 4, 20467, 1, 4, 0, 141992, 32, 100788,
420, 1, 1, 81663, 32, 59498, 32, 20142, 32, 24588, 32, 20744, 32, 25933, 32,
24623, 32, 43053543, 10, 53384111, 14333, 10, 43574283, 26308, 10, 16000,
100, 16000, 100, 962335, 18, 2780678, 6, 442008, 1, 52538055, 3756, 18,
267929, 18, 76433006, 8868, 18, 52948122, 18, 1995836, 36, 3227919, 12,
901022, 1, 166917843, 4307, 36, 284546, 36, 158221314, 26549, 36, 74698472,
36, 333849714, 1, 254006273, 72, 2174038, 72, 2261318, 64571, 4, 207616,
8310, 4, 1293828, 28716, 63, 0, 1, 1006041, 43623, 251, 0, 1, 100181, 726,
719, 0, 1, 100181, 726, 719, 0, 1, 100181, 726, 719, 0, 1, 107878, 680, 0,
1, 95336, 1, 281145, 18848, 0, 1, 180194, 159, 1, 1, 158519, 8942, 0, 1,
159378, 8813, 0, 1, 107490, 3298, 1, 106057, 655, 1, 1964219, 24520, 3,
],
]; |
Just to give more context here in case it is the reason. Mesh currently still uses the soon to be deprecated But it hasn't actually been deprecated yet, so I assume it should still work. |
Step 1 was also done using Mesh to build a scaffold for spending script inputs, then completed using the |
For further context, here is the txHex of a StakeRegistration (this transaction is accepted, and updates the snapshot)
And then the txHex of a subsequent withdrawal (that doesn't work)
And given this validationError
|
Context & versions
Hydra version: 0.19.0
Cardano node version: 10.1.2
I am also using custom protocol params
Steps to reproduce
Actual behavior
This validation error is seen in the withdrawal transaction. This occurs in the cases where, a credential has not been registered, OR an incomplete withdrawal has been attempted.
It is also possible to register the credential again (which shouldn't be possible if the credential has already been registered).
Expected behavior
A successful withdrawal, or at least an error that comes from running the script in the Script Hash credential.
I'm actually quite curious about how hydra nodes handle staking and reward calculations in general.
The text was updated successfully, but these errors were encountered: