8000 feat: blockchain errors for humans by 3Hren · Pull Request #1291 · sonm-io/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: blockchain errors for humans #1291

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

Merged
merged 2 commits into from
Aug 21, 2018
Merged

Conversation

3Hren
Copy link
Member
@3Hren 3Hren commented Aug 9, 2018

This commit activates special interceptor on Node that performs userland
verification before opening a deal. This allows to return human-readable
errors instead of "Transaction failed" in case of where it is impossible
for some reasons to open a deal.

Now it looks like this

esafronov@esafronov:~/go/src/github.com/sonm-io/core|feat/blockchain/wrap-market⚡
⇒  ./target/sonmcli_darwin_x86_64 deal open 152069 151941 --force
[ERR] cannot open deal: rpc error: code = Unknown desc = could not open deal in blockchain: ask order must be active, but it is ORDER_INACTIVE
esafronov@esafronov:~/go/src/github.com/sonm-io/core|feat/blockchain/wrap-market⚡
⇒  ./target/sonmcli_darwin_x86_64 deal open 152071 151941 --force
[ERR] cannot open deal: rpc error: code = Unknown desc = could not open deal in blockchain: bid price 20395269000000 must be >= ask price 166666666666666
esafronov@esafronov:~/go/src/github.com/sonm-io/core|feat/blockchain/wrap-market⚡
⇒  ./target/sonmcli_darwin_x86_64 deal open 152071 151885 --force
[ERR] cannot open deal: rpc error: code = Unknown desc = could not open deal in blockchain: bid price 86386419000000 must be >= ask price 166666666666666
esafronov@esafronov:~/go/src/github.com/sonm-io/core|feat/blockchain/wrap-market⚡
⇒  ./target/sonmcli_darwin_x86_64 deal open 152071 152070 --force
[ERR] cannot open deal: rpc error: code = Unknown desc = could not open deal in blockchain: bid must have BID type, but it is ASK
esafronov@esafronov:~/go/src/github.com/sonm-io/core|feat/blockchain/wrap-market⚡
⇒  ./target/sonmcli_darwin_x86_64 deal open 152071 151874 --force
[ERR] cannot open deal: rpc error: code = Unknown desc = could not open deal in blockchain: bid price 83796350000000 must be >= ask price 166666666666666
esafronov@esafronov:~/go/src/github.com/sonm-io/core|feat/blockchain/wrap-market⚡
⇒  ./target/sonmcli_darwin_x86_64 deal open 151176 151874 --force
[ERR] cannot open deal: rpc error: code = Unknown desc = could not open deal in blockchain: bid price 83796350000000 must be >= ask price 166666666666666
esafronov@esafronov:~/go/src/github.com/sonm-io/core|feat/blockchain/wrap-market⚡
⇒  ./target/sonmcli_darwin_x86_64 deal open 151158 151874 --force
[ERR] cannot open deal: rpc error: code = Unknown desc = could not open deal in blockchain: benchmark matching failed: id=7 bid benchmark 1 must be <= ask benchmark 0
esafronov@esafronov:~/go/src/github.com/sonm-io/core|feat/blockchain/wrap-market⚡
⇒  ./target/sonmcli_darwin_x86_64 deal open 151158 151871 --force
[ERR] cannot open deal: rpc error: code = Unknown desc = could not open deal in blockchain: benchmark matching failed: id=7 bid benchmark 1 must be <= ask benchmark 0
esafronov@esafronov:~/go/src/github.com/sonm-io/core|feat/blockchain/wrap-market⚡
⇒  ./target/sonmcli_darwin_x86_64 deal open 151158 151866 --force
[ERR] cannot open deal: rpc error: code = Unknown desc = could not open deal in blockchain: benchmark matching failed: id=7 bid benchmark 1 must be <= ask benchmark 0
esafronov@esafronov:~/go/src/github.com/sonm-io/core|feat/blockchain/wrap-market⚡
⇒  ./target/sonmcli_darwin_x86_64 deal open 151158 151868 --force
[ERR] cannot open deal: rpc error: code = Unknown desc = could not open deal in blockchain: benchmark matching failed: id=7 bid benchmark 1 must be <= ask benchmark 0
esafronov@esafronov:~/go/src/github.com/sonm-io/core|feat/blockchain/wrap-market⚡
⇒  ./target/sonmcli_darwin_x86_64 deal open 152071 151868 --force
[ERR] cannot open deal: rpc error: code = Unknown desc = could not open deal in blockchain: ask order must be active, but it is ORDER_INACTIVE
esafronov@esafronov:~/go/src/github.com/sonm-io/core|feat/b
8000
lockchain/wrap-market⚡
⇒  ./target/sonmcli_darwin_x86_64 deal open 152070 151868 --force
[ERR] cannot open deal: rpc error: code = Unknown desc = could not open deal in blockchain: ask order must be active, but it is ORDER_INACTIVE
esafronov@esafronov:~/go/src/github.com/sonm-io/core|feat/blockchain/wrap-market⚡
⇒  ./target/sonmcli_darwin_x86_64 deal open 152074 151868 --force
[ERR] cannot open deal: rpc error: code = Unknown desc = could not open deal in blockchain: bid price 82882208000000 must be >= ask price 166666666666666
esafronov@esafronov:~/go/src/github.com/sonm-io/core|feat/blockchain/wrap-market⚡
⇒  ./target/sonmcli_darwin_x86_64 deal open 152074 150825 --force
[ERR] cannot open deal: rpc error: code = Unknown desc = could not open deal in blockchain: bid counterparty 0xedB7Ae4B946Cf249349974A02e354B5FBC577798 doesn't match with ask master 0xAAA932d77935EE3d8E0Ba1d464CFDA4E56566A01
esafronov@esafronov:~/go/src/github.com/sonm-io/core|feat/blockchain/wrap-market⚡
⇒  #./target/sonmcli_darwin_x86_64 deal open 152074 150825 --force


@3Hren 3Hren requested review from antmat, zavgorodnii, nikonov1101 and a team as code owners August 9, 2018 09:06
@3Hren 3Hren added T: WIP This PR/Issue still in progress T: feature This PR/Issue adds a new feature P: medium This PR/Issue has normal priority V: minor This PR/Issue required minor version to be bumped S: Blockchain This PR/Issue changes Blockchain API labels Aug 9, 2018
This commit activates special interceptor on Node that performs userland
verification before opening a deal. This allows to return human-readable
errors instead of "Transaction failed" in case of where it is impossible
for some reasons to open a deal.
@3Hren 3Hren force-pushed the feat/blockchain/wrap-market branch from 6869485 to b1b7830 Compare August 9, 2018 11:33
@3Hren 3Hren removed the T: WIP This PR/Issue still in progress label Aug 9, 2018
nikonov1101
nikonov1101 previously approved these changes Aug 9, 2018
8000
if err := wg.Wait(); err != nil {
return nil, fmt.Errorf("blacklist check failed: %v", err)
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you feel about actually calling blacklist.Verify()?

@antmat antmat merged commit 04821cc into master Aug 21, 2018
@antmat antmat deleted the feat/blockchain/wrap-market branch August 21, 2018 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P: medium This PR/Issue has normal priority S: Blockchain This PR/Issue changes Blockchain API T: feature This PR/Issue adds a new feature V: minor This PR/Issue required minor version to be bumped
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0