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

les: fix balance expiration #22343

Merged
merged 3 commits into from
Feb 19, 2021
Merged

Conversation

zsfelfoldi
Copy link
Contributor

This PR fixes a light server bug that was introduced by the refactoring of the client pool and adds a unit test. The exponential balance expiration did not work correctly because the expirer state was saved on shutdown but not loaded at startup, therefore the calculated balance values were off. Luckily currently only the negative balances of free clients were used in production so the only issue this bug has caused was that some free clients were treated unfairly by some servers. Still, this bug can negatively affect the usability of LES so this fix should be merged and deployed to the bootnodes ASAP.
Note: the PR also moves client balances to a new and separate database. I wanted to do this change anyways because the balances do not belong to the chain db and this is a good moment because the database reset ensures that the different values of the balance expiration mechanism are in sync.

les/client.go Outdated Show resolved Hide resolved
les/server.go Outdated Show resolved Hide resolved
Copy link
Member

@rjl493456442 rjl493456442 left a comment

Choose a reason for hiding this comment

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

nitpicks, otherwise lgtm.

Copy link
Member

@rjl493456442 rjl493456442 left a comment

Choose a reason for hiding this comment

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

lgtm

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.

2 participants