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

multi: allow no dcr reg fee config on server, remove dcr-specific fields #2293

Merged
merged 4 commits into from
Apr 19, 2023

Conversation

chappjc
Copy link
Member

@chappjc chappjc commented Apr 10, 2023

The first commit removes the server's startup requirement of having DCR reg fee info specified. This was a hold-over from before we even had multi-asset reg fee support. There is still the RegFees map (which may also be empty in a bonds-only config).

The second commit removes the warning about a server that does not support DCR for registration. This also removes the handling of ancient servers that even lacked the RegFees map (only had the dcr-specific fields).

Comment on lines -1299 to -1300
Fee uint64 `json:"fee"` // DEPRECATED
RegFeeConfirms uint16 `json:"regfeeconfirms"` // DEPRECATED
Copy link
Member Author

@chappjc chappjc Apr 10, 2023

Choose a reason for hiding this comment

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

Released clients will see a Fee of 0, and block registration (See (*Core).Register)

Amt: cfg.Fee,
}
} else {
dc.log.Warnf("Server %v does not support DCR for registration", dc.acct.host)
Copy link
Member Author

Choose a reason for hiding this comment

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

Released clients will warn about this, but it's no longer an issue.

Comment on lines -889 to -893
dc.log.Warnf("Legacy server %v does not provide a regFees map.", dc.acct.host)
if cfg.RegFees == nil {
cfg.RegFees = make(map[string]*msgjson.FeeAsset)
}
if cfg.Fee > 0 {
Copy link
Member Author

Choose a reason for hiding this comment

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

Release clients will incorrectly refer to this as a "Legacy server" if the server lacks a DCR entry in the map, but the behavior is otherwise fine (block registering with DCR).

@chappjc chappjc added this to the 0.6.1 milestone Apr 10, 2023
Comment on lines -903 to -909
if cfg.Fee > 0 && dcrAsset.Amt != cfg.Fee {
dc.log.Warnf("Inconsistent DCR fee amount: %d != %d", dcrAsset.Amt, cfg.Fee)
}
if dcrAsset.Confs != uint32(cfg.RegFeeConfirms) {
dc.log.Warnf("Inconsistent DCR fee confirmation requirement: %d != %d",
dcrAsset.Confs, cfg.RegFeeConfirms)
}
Copy link
Member Author

Choose a reason for hiding this comment

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

Released clients will also warn about this because these dcr-specific fields will be zero with a server running the code changes in this PR, but the clients will still use any set DCR values in the RegFees map.

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.

When running an older client, the UI still shows DCR as a registration asset, even though the
server does not support it:
Screenshot 2023-04-11 at 10 45 24 AM

@chappjc
Copy link
Member Author

chappjc commented Apr 11, 2023

Can't think of any way to trick old clients into not displaying that, aside from a patch for them

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.

They should just upgrade to 0.6 anyways.

chappjc added 4 commits April 18, 2023 17:05
If target tier is <= 0, do not spam about the missing bond wallet.
The default bond wallet (42/dcr) might not be configured at all.
This is mostly for legacy fee clients.
@chappjc chappjc merged commit c6d6793 into decred:master Apr 19, 2023
@chappjc chappjc deleted the no-dcr-reg-fee branch April 19, 2023 02:55
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.

3 participants