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

Propagate tx info into ServerErrors #388

Merged
merged 8 commits into from
Nov 16, 2020
Merged

Propagate tx info into ServerErrors #388

merged 8 commits into from
Nov 16, 2020

Conversation

ilblackdragon
Copy link
Member

No description provided.

@@ -57,6 +69,8 @@ function walkSubtype(errorObj, schema, result, typeName) {
}
return walkSubtype(error, schema, result, errorTypeName);
} else {
// TODO: is this the right thing to do?
Copy link
Contributor

Choose a reason for hiding this comment

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

unfortunately I don't know, as I have no understanding of what are possible responses from nearcore side.

also I think we should completely remove everything related to error schema #331

Copy link
Contributor

Choose a reason for hiding this comment

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

@bowenwang1996 I feel like you may know a bit about the nearcore errors. Would you mind giving us your two cents when you get a moment this week?

Copy link
Contributor

Choose a reason for hiding this comment

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

an error only has kind if it is an action error but there are many other errors out there

@ilblackdragon ilblackdragon marked this pull request as ready for review September 8, 2020 19:02
@chadoh chadoh requested review from vgrichina and removed request for chadoh October 12, 2020 21:05
@mikedotexe
Copy link
Contributor

@vgrichina this repo is important in the dependency chain for the EVM tooling. Can we prioritize getting this looked at this week, please?

@mikedotexe
Copy link
Contributor

Initially I thought we simply needed the section where exports happen in the second commit here:
81f6403#diff-fff0ee1c855d7fdef5ec027268d27066a50d0c0dc4e4832b51f8a2e40129e177R37-R44

because without that, Balancer tests fail saying:

ERROR: TypeError: nearAPI.transactions.FunctionCall is not a constructor

Adding those exports alone solves that, but we do need this full PR in order to get the best results from tests.
Included here are two text files showing the Balancer test results

9-failing-with_account-errors_branch.txt
39-failing-only-with-export.txt

I'm wondering how we can get this PR moving along. I don't know a ton about errors, except that it might be a heavy lift to address the line that we're commenting about here We're trying to keep a pretty aggressive timeline in terms of having the EVM-related PRs buttoned up ASAP. Wondering how I can help, and what the expected lift is for this. I'll tag @djsatok so we can make sure this project is tracked

# Conflicts:
#	dist/near-api-js.js
#	dist/near-api-js.min.js
#	lib/browser-index.js
#	lib/common-index.js
#	lib/index.js
#	lib/providers/provider.js
#	lib/utils/index.js
#	lib/utils/rpc_errors.js
#	lib/utils/serialize.js
Copy link
Contributor

@mikedotexe mikedotexe left a comment

Choose a reason for hiding this comment

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

Ran a bunch of other checks in addition to the rather thorough tests we have here.
Nonexistent account
./bin/near state nonexistent
When no connection to RPC is there:
NEAR_ENV=local ./bin/near state nonexistent
When a wrong argument type is given:
./bin/near view oracle.chainlink.testnet get_all_requests '{"max_num_accounts": "100", "max_requests": "abc"}'
Calling nonexistent method:
./bin/near view oracle.chainlink.testnet ZZZget_all_requests '{"max_num_accounts": "100", "max_requests": "abc"}'

The only test that had issues was getting cross-contract failures, but finally figured it out that we needed to explicitly add the error.type and error.message and now everything is behaving perfectly.

Also, talked to Vlad about this yesterday, and while there is discussion about completely removing the class-based way that errors are handled currently, it's better to have that be a separate task.

This PR addresses EVM closely, especially with "revert" errors, so this PR represents a major improvement for the EVM and we'd like to merge it asap.

@mikedotexe
Copy link
Contributor

Note: we are going to hold off on merging this until we've resolved this issue:
near/nearcore#3544

# Conflicts:
#	lib/account_multisig.js
#	lib/browser-index.js
#	lib/common-index.js
#	lib/index.js
#	lib/utils/index.js
#	lib/utils/rpc_errors.js
#	lib/utils/serialize.js
@mikedotexe mikedotexe marked this pull request as ready for review November 16, 2020 05:48
@mikedotexe mikedotexe merged commit 8fa8780 into master Nov 16, 2020
@mikedotexe mikedotexe deleted the account-errors branch November 16, 2020 15:24
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.

4 participants