Skip to content
This repository was archived by the owner on Aug 27, 2025. It is now read-only.

Don't fail when outgoing message amounts sum to more than current balance#989

Closed
jjcnn wants to merge 4 commits intomasterfrom
remove_send_balance_check
Closed

Don't fail when outgoing message amounts sum to more than current balance#989
jjcnn wants to merge 4 commits intomasterfrom
remove_send_balance_check

Conversation

@jjcnn
Copy link
Contributor

@jjcnn jjcnn commented May 21, 2021

Scilla uses acceptance semantics, so we should not throw an error just because a contract sends out more money than it has. The error should not occur to until the recipients have accepted more funds than the contract has.

I'm unsure what we should output as the balance in the json output. Several options make sense:

  • Output the balance without subtracting anything (this corresponds to the state immediately after the transition finishes)
  • Output the balance with the outgoing amounts subtracted, but no less than 0 (this corresponds to the worst-case scenario, because the balance can never go below 0 anyway)
  • Output the balance with the outgoing amounts subtracted, even if it is negative (this would make it easier for IDE's to issue the warning that we can't issue from scilla-runner)

@jjcnn
Copy link
Contributor Author

jjcnn commented May 21, 2021

The tests I've added should be replicated on the C++ side as well, especially for the case where the recipients are user accounts. From Scilla's point of view a user account behaves like a contract that defines the following transition for every possible transition name (as well as the empty string):

transition <name> ()
  accept
end

@jjcnn jjcnn closed this Jun 17, 2021
@jjcnn jjcnn reopened this Jun 17, 2021
@jjcnn jjcnn marked this pull request as draft June 17, 2021 15:36
@jjcnn
Copy link
Contributor Author

jjcnn commented Jun 17, 2021

Converting to draft, pending discussions with @AmritKumar and others.

@jjcnn
Copy link
Contributor Author

jjcnn commented Jul 13, 2021

Closing, as this PR is superseeded by #1032 .

@jjcnn jjcnn closed this Jul 13, 2021
@jjcnn jjcnn deleted the remove_send_balance_check branch July 13, 2021 08:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants