-
Notifications
You must be signed in to change notification settings - Fork 21k
les: implement les4 and UDP extension for token sale #20517
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
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66a352a
to
3ffbcc7
Compare
zsfelfoldi
commented
Feb 12, 2020
} | ||
t.qlock.Lock() | ||
s.ch = nil | ||
t.qlock.Unlock() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a data race:
- the loop tries to exit and wait the
qlock
to release channel. - however is the lock is obtained by another
queueCommand
call and the cmd is queued in the channel - loop gets the lock and set nil
- new queued cmd is dropped silently
les: first part of les4 purposed changed
holiman
reviewed
Apr 7, 2020
Comment on lines
+276
to
+278
ReqID uint64 | ||
SF stateFeedback | ||
Receipts []types.Receipts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If these are actual network messages, how come they aren't publically exposed, but only anonymous inlined structs?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements
tokenSale
that provides functions (lesPay
commands) for depositing funds, buying/selling service tokens, querying prices, balances and connection availabilitytestReceiver
is included)pcBalance
) in addition to the already existing service token balancelesPay
commands protects from DoS attacks while the "recommended delay" feedback makes it easy for clients to behave nicely while still being as efficient as possibleclientPool
is not filled with priority clients and therefore all service tokens are spendable (kind of a "spendability fee")balanceTracker
and the token balance database now useexpiredValue
which handles exponential decrease without regular updatingclientPool
:clientPool
will be made up for with a simplerserverPool
logicles/4
protocol extension withLespayMsg
andLespayReplyMsg
to provide access to thelesPay
commands in-protocolles/4
so earlier clients are still dropped instantlytalkRequest
andtalkResponse
packets are added todiscv5
which is used by LES to makelesPay
also accessible through UDP when not connectedPrivateLespayAPI
provides user access to thelesPay
commands on either the local or a remote server