les: implement les4 and UDP extension for token sale#20517
Closed
zsfelfoldi wants to merge 16 commits intoethereum:masterfrom
Closed
les: implement les4 and UDP extension for token sale#20517zsfelfoldi wants to merge 16 commits intoethereum:masterfrom
zsfelfoldi wants to merge 16 commits intoethereum:masterfrom
Conversation
66a352a to
3ffbcc7
Compare
zsfelfoldi
commented
Feb 12, 2020
| } | ||
| t.qlock.Lock() | ||
| s.ch = nil | ||
| t.qlock.Unlock() |
Member
There was a problem hiding this comment.
There is a data race:
- the loop tries to exit and wait the
qlockto release channel. - however is the lock is obtained by another
queueCommandcall 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 |
Contributor
There was a problem hiding this comment.
If these are actual network messages, how come they aren't publically exposed, but only anonymous inlined structs?
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
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
tokenSalethat provides functions (lesPaycommands) for depositing funds, buying/selling service tokens, querying prices, balances and connection availabilitytestReceiveris included)pcBalance) in addition to the already existing service token balancelesPaycommands protects from DoS attacks while the "recommended delay" feedback makes it easy for clients to behave nicely while still being as efficient as possibleclientPoolis not filled with priority clients and therefore all service tokens are spendable (kind of a "spendability fee")balanceTrackerand the token balance database now useexpiredValuewhich handles exponential decrease without regular updatingclientPool:clientPoolwill be made up for with a simplerserverPoollogicles/4protocol extension withLespayMsgandLespayReplyMsgto provide access to thelesPaycommands in-protocolles/4so earlier clients are still dropped instantlytalkRequestandtalkResponsepackets are added todiscv5which is used by LES to makelesPayalso accessible through UDP when not connectedPrivateLespayAPIprovides user access to thelesPaycommands on either the local or a remote server