So I try to participate and commit the max participation to a SNS Swap that has been initiated locally through a proposal. Everything works fine until the finalization. The resulting SNS - i.e. the tokens and neurons - never appear in NNS dapp.
I copied all the logs that are printed to the terminal and I cannot find any reference of the keywords “error”.
On the contrary I noticed that the Swap is aborted.
I the Swap does not have neuron fund participation, I find this log:
2024-07-13 12:54:18.537999 UTC: [Canister rrkah-fqaaa-aaaaa-aaaaq-cai] [Governance] INFO: The Neurons’ Fund does not participate in the SNS created with ProposalId ProposalId { id: 5 }. Setting lifecycle to Aborted and returning empty list of Neurons’ Fund participants.
And it there is a neuron fund participation:
2024-07-13 12:48:52.844083 UTC: [Canister rrkah-fqaaa-aaaaa-aaaaq-cai] [Governance] INFO: The Swap canister of the SNS created via proposal ProposalId { id: 4 } has reported that the swap had been aborted. There should not be Neurons’ Fund participation.
2024-07-13 12:48:52.844083 UTC: [Canister rrkah-fqaaa-aaaaa-aaaaq-cai] [Governance] INFO: The Neurons’ Fund has decided against participating in the SNS created via proposal ProposalId { id: 4 }.
2024-07-13 12:48:52.844083 UTC: [Canister rrkah-fqaaa-aaaaa-aaaaq-cai] [Governance] INFO: About to refund 1 Neurons’ Fund neurons with a total of 750000000000 ICP e8s (after settling the SNS swap created via proposal ProposalId { id: 4 }) …
I don’t know if it’s the error given that the message is printed as “INFO” but the lifecycle of the swap as collected by the SNS aggregator is indeed reported as “Aborted” (lifecycle: 4).
I doubt the issue has to do with the neuron fund participation given that with or without it (neurons_fund_participation: true | false), the swap ends in “Aborted” status.
I randomly met Leo today, who shared with me the solution. He knows it because he faced it too when they developed their SNS.
The swap was silently aborted because I committed to the maximum direct participation in ICP with two test users, while the swap was set to require a minimum of ten participants.
Lowering the number of participants to one for testing purposes resolved the issue.
If this only happens locally, it would be developer-friendly to improve the tooling to output some logs.
If this can potentially happen on the mainnet too, it would be nice to improve the NNS dapp to render information or a warning that committing the maximum amount will lead to the SNS failing, unless of course I misread the UI and such a feature is already implemented.
Regarding the logs, I would expect to see at least Swap aborted at timestamp … in Swap’s logs. Note that this is not the stdout log from the replica but rather the /logs HTTP endpoint of Swap (printing to stdout wouldn’t be very useful on the mainnet for non-NNS canisters as those logs do not get appended to the replica logs).
So one could also monitor curl http://$SWAP_CANISTER_ID.localhost:8080/logs | jq to see the logs produced by the Swap canister.
In my opinion, it would make sense to redirect those errors to stdout in that case, given that I’m not the first developer who has faced this error. I would have spared few hours, and this thread would not even exist if that were the case.
I just lost 30 minutes of my life and my blood pressure skyrocketed as I’m about to propose an SNS for real tomorrow because I forgot about this. It would be nice if the foundation improved the developer experience by providing more meaningful error messages.