Repository navigation
Check contract-account debtors when they sign, not at submission - #14
Merged
Merged
Conversation
A debtor that is a contract account checks its own signature, so its entry was accepted on trust and a bad one only surfaced when the batch was simulated for submission, holding up everyone in it. Accept now simulates a batch in enforcing mode as soon as a submission completes it, before recording anything. If the request brought a contract account's entry and the network refuses the batch, the request is refused with the network's reason. If it brought only account signatures (already checked locally), those are kept and the contract accounts' entries are cleared with the reason, shown in GET .../authorizations as error, so only they sign again. An unreachable RPC records nothing and the debtor retries. settletest models contract accounts whose __check_auth takes an Ed25519 signature as bytes. Tests cover a bad signature refused at the moment it is posted, then the right one settling, and a bad signature found when an account completes the batch. Closes #11.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #11.
A debtor that is a contract account (a smart wallet with its own
__check_auth) was accepted on trust, so a bad signature only surfaced when the batch was simulated for submission, holding up every debtor in it.Acceptnow simulates a batch in enforcing mode as soon as a submission completes it, before recording anything:errorinGET …/authorizations, so only those parties sign again.A contract account's signature can't be checked while other debtors in its batch are unsigned, because enforcing simulation needs every entry. So the check runs at the moment the batch becomes complete, whoever completes it.
Tests
settletestnow models contract accounts whose__check_authtakes an Ed25519 signature as bytes.go vet,go test -race ./...and golangci-lint (0 issues) all pass. README, OpenAPI and CHANGELOG are updated, and the roadmap item is done.