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

client/asset/eth: less provider check spam #2159

Merged
merged 3 commits into from
Feb 23, 2023

Conversation

chappjc
Copy link
Member

@chappjc chappjc commented Feb 22, 2023

Resolves #2158

This quiets down the logs from the RPC provider compatibility tests,
which was only supposed to be enable for testing and debugging.

This also removes a duplicate check for PendingNonceAt.

This also removes the redundant sublogger so that
CORE[eth][ETH] becomes just CORE[eth].  Same on server.

Finally, the changes the subloger used by CreateWallet not be
CORE[CREATE], and instead just show the asset symbol.

This also resolves the missing parent path for the compliant providers json file on initial wallet creation.

@chappjc chappjc added this to the 0.6 milestone Feb 22, 2023
@chappjc
Copy link
Member Author

chappjc commented Feb 22, 2023

Compared to #2158, it now looks like:

2023-02-22 10:50:02.080 [TRC] CORE: wallet status requested for unknown asset 60 -> eth
2023-02-22 10:50:02.115 [INF] CORE: Initializing a eth wallet
2023-02-22 10:50:02.118 [DBG] CORE[eth]: Connected with 1 of 1 RPC servers
2023-02-22 10:50:02.118 [TRC] CORE[eth]: handling websocket subscriptions for "127.0.0.1:38559"
2023-02-22 10:50:02.118 [TRC] CORE[eth]: handling header refreshes for "127.0.0.1:38559"
2023-02-22 10:50:02.228 [DBG] CORE[eth][RPC]: Connected with 1 of 1 RPC servers
2023-02-22 10:50:02.228 [TRC] CORE[eth][RPC]: handling websocket subscriptions for "127.0.0.1:38559"
2023-02-22 10:50:02.228 [TRC] CORE[eth][RPC]: handling header refreshes for "127.0.0.1:38559"
2023-02-22 10:50:02.228 [TRC] CORE[eth][RPC]: Using cached header from "127.0.0.1:38559"
2023-02-22 10:50:02.242 [INF] CORE[eth][TXDB]: All 0 tables opened in 0s

2023-02-22 10:50:02.243 [INF] CORE[eth]: Connected to geth, at height 45
2023-02-22 10:50:02.243 [TRC] CORE[eth][RPC]: Using cached header from "127.0.0.1:38559"
2023-02-22 10:50:02.243 [TRC] CORE: New peer count for asset eth: 1
2023-02-22 10:50:02.299 [INF] CORE: Created eth wallet. Balance available = 0 / locked = 0 / locked in contracts = 0, Deposit address = 0xa2089C2290f6B0B4f0e4B07037C8495921007Cb3
2023-02-22 10:50:02.299 [TRC] CORE[eth][RPC]: Using cached header from "127.0.0.1:38559"
2023/02/22 10:50:02 "POST http://127.0.0.3:5758/api/newwallet HTTP/1.1" from 127.0.0.1:42310 - 200 12B in 226.358174ms
2023-02-22 10:50:10.861 [TRC] CORE[eth][RPC]: "127.0.0.1:38559" reported new tip at height 46 (0x33592bc3a31e2d96901ca21afd45296e5831901730eeeb0576fdcfeb60f758cf)
2023-02-22 10:50:11.002 [TRC] CORE[eth][RPC]: "127.0.0.1:38559" reported new tip at height 47 (0x6257957577fe32bcc495055f5bebaa194678777b7b64211258bb2c61b7123780)
2023-02-22 10:50:11.244 [DBG] CORE[eth]: tip change: 45 (0x7d0feb40eed8fe90cf29e9ffffcb8cbeeb00b908fdccf08a0de77a6198679a90) => 47 (0x6257957577fe32bcc495055f5bebaa194678777b7b64211258bb2c61b7123780)
2023-02-22 10:50:11.244 [TRC] CORE: Processing tip change for eth
2023-02-22 10:50:12.003 [TRC] CORE[eth][RPC]: "127.0.0.1:38559" reported new tip at height 48 (0xa5949c622ac816270d8b310d989fba9c4b4ea93cb7e519192afa6aa1c560c272)
2023-02-22 10:50:12.244 [DBG] CORE[eth]: tip change: 47 (0x6257957577fe32bcc495055f5bebaa194678777b7b64211258bb2c61b7123780) => 48 (0xa5949c622ac816270d8b310d989fba9c4b4ea93cb7e519192afa6aa1c560c272)
2023-02-22 10:50:12.244 [TRC] CORE: Processing tip change for eth

@buck54321
Copy link
Member

buck54321 commented Feb 22, 2023

The compatibility tests weren't supposed to be logging at all outside of tests (nil -> slog.Disabled). For some reason, a logger was added in #2102.
image

This quiets down the logs from the RPC provider compatibility tests,
which was only supposed to be enable for testing and debugging.

This also removes a duplicate check for PendingNonceAt.

This also removes the redundant sublogger so that
CORE[eth][ETH] becomes just CORE[eth].  Same on server.

Finally, the changes the subloger used by CreateWallet not be
CORE[CREATE], and instead just show the asset symbol.
@@ -697,7 +696,7 @@ func createAndCheckProviders(ctx context.Context, walletDir string, endpoints []
if len(providers) != len(unknownEndpoints) {
return providersErr(providers)
}
if err := checkProvidersCompliance(ctx, providers, net, log); err != nil {
if err := checkProvidersCompliance(ctx, providers, net, dex.Disabled /* logger is for testing only */); err != nil {
Copy link
Member Author

@chappjc chappjc Feb 22, 2023

Choose a reason for hiding this comment

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

Could do this when calling createAndCheckProviders, but that's only used in product code, whereas the tests use checkProvidersCompliance directly.
Happy to change.

EDIT: There are some logs up there we probably would want.

Comment on lines +1451 to +1452
default: // caller should have checked though
panic(fmt.Sprintf("Unknown net %v in compatibility tests. Testing data not initiated.", net))
Copy link
Member Author

@chappjc chappjc Feb 22, 2023

Choose a reason for hiding this comment

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

In the product code, there are probably 30 places it would panic before getting here anyway. It's virtually impossible to get an unrecognized dex.Network here with the product where it's checked first thing on app bring-up.

Copy link
Contributor

@martonp martonp left a comment

Choose a reason for hiding this comment

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

Looks way nicer. I don't think it would be bad to leave the logger on if everything is debug level though.. you could even make it trace.

@chappjc
Copy link
Member Author

chappjc commented Feb 22, 2023

Just pushed an inconsequential commit to remove "geth" from a few spots where it's no longer right. There was also some needless bloat in SyncStatus checking an always-nil error, so cleaned that up too.
Won't push anything further unless changes requested.

@@ -3947,7 +3939,8 @@ func (w *assetWallet) estimateTransferGas(val uint64) (gas uint64, err error) {

// redeem redeems a swap contract. Any on-chain failure, such as this secret not
// matching the hash, will not cause this to error.
func (w *assetWallet) redeem(ctx context.Context, assetID uint32, redemptions []*asset.Redemption, maxFeeRate, gasLimit uint64, contractVer uint32, nonceOverride *uint64) (tx *types.Transaction, err error) {
func (w *assetWallet) redeem(ctx context.Context, assetID uint32 /* ?? */, redemptions []*asset.Redemption,
Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know what this input parameter is about. Should it have been used or was this copy pasta from other methods like this?

@chappjc chappjc merged commit 141198e into decred:master Feb 23, 2023
@chappjc chappjc deleted the eth-log-stuff branch February 23, 2023 19:09
@chappjc chappjc added the ETH label Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

provider compliance checks spew confusing info
4 participants