Skip to content
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

Return errors to client via jsonrpc #1361

Merged
merged 2 commits into from
Sep 27, 2018

Conversation

garious
Copy link
Contributor

@garious garious commented Sep 26, 2018

Before this patch, the client could not tell the difference between a transaction that's been seen by the network, and one that failed because of a bug in its program. With this patch, the client can detect if the transaction was not seen, whether it succeed, or how the the transaction failed. Missing bits of information that still exist:

  • Can't tell the difference between a transaction that hasn't been seen and one whose signature has been purged because it's too old.
  • Can't tell what the specific program error was, just that the error was detected in the program versus in the bank.

Also updated the test about potentially desirable behavior (cc #1157). The only part that's undesirable now is that the bank isn't taking the fee when it knows the transaction's program failed. It should.

One thing I don't like about this PR is that it shares too much information with the client. jsonrpc should probably define a separate error structure similar to BankError and maintain backward compatibility.

Fixes #1298

See solana-labs#1157 for details. The `from` account should be cloned
before execute_transaction(), and that's the only one that should
be stored if there's an error executing the program.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants