Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Error handling on deferred transactions
Our scheduler replaces the old EOSIO deferred transactions.
When deferred actions fail, they need to be removed from the list - otherwise the action never executes, and is never removed from the list because the entire executenext action fails. So we end up with an infinite loop trying to execute an action that has an error.
We accommodate timeout errors by trying a few times.
We also catch "nothing to execute" errors.
For all other errors, we remove the action from the scheduler table, since it cannot be executed.
Ideally there won't be any invalid actions in the scheduler's list, but we saw the error now when the contract is trying to call close prop on staged proposals, causing an error.
We never saw these errors in the past, they were on deferred transactions and failing silently. The fix is to remove the scheduled close doc prop action for staged proposals, but the scheduler needs to deal with failing actions anyway.
This required changes in the contract, the permissions, and the scheduler script.
Contract changes
Added removedtx action
Permissions changes
Added scheduler permission to dao.hypha
Link scheduler permission with removedtx action
Script changes
Catch errors in actions, and call removedtx in case a scheduled action fails.
Other changes in this PR: Some cleanups.
See also
hypha-dao/hypha-smart-contracts#26
https://github.com/JoinSEEDS/hypha-accept-payments/pull/28
Deploy Status
Note: Backend deployed
Telos Testnet - waiting for keys from Gery - need owner key to add permission
Telos Mainnet - deferred transactions still work, we need to switch to new contract by msig: Deploy new contract and change permissions.