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

Fix multi ledger #30

Merged
merged 7 commits into from
Aug 12, 2022
Merged

Conversation

matthiasgeihs
Copy link
Contributor

Fixes a few problems with the multi-ledger funder and adjudicator. See commits messages for more details.

Previously we only tested the special case where funds are placed only
from one side. However, in a different project we noticed that there
was actually a bug when placing funds on both sides. Hence, we adapt
the test setup.

Signed-off-by: Matthias Geihs <matthias@perun.network>
For tests with the simulated Ethereum blockchain, we need to scale the
challenge duration time because the simulated chain ticks very fast.

Signed-off-by: Matthias Geihs <matthias@perun.network>
We counted the number of expected events incorrectly. Concretely, we
double counted in some cases. Now changed the confirmation logic to
check for the remaining required funding instead of counting events.

Signed-off-by: Matthias Geihs <matthias@perun.network>
Previously, if we called Channel.Settle too early, the call would fail. This was inconvenient but not a big problem because we can just retry. However, with multi-ledger channels, the case where the conclude call arrives before it can be dispatched happens more frequently, as the different ledgers are usually not perfectly in sync. Hence, we change the conclude logic to wait on each ledger until the dispute period is over and the conclude call will succeed.

Signed-off-by: Matthias Geihs <matthias@perun.network>
Signed-off-by: Matthias Geihs <matthias@perun.network>
cryptphil
cryptphil previously approved these changes Aug 11, 2022
channel/funder.go Show resolved Hide resolved
channel/conclude.go Show resolved Hide resolved
channel/conclude.go Show resolved Hide resolved
channel/conclude.go Outdated Show resolved Hide resolved
Signed-off-by: Matthias Geihs <matthias@perun.network>
Signed-off-by: Matthias Geihs <matthias@perun.network>
Copy link
Member

@cryptphil cryptphil left a comment

Choose a reason for hiding this comment

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

Nice 🚀

@cryptphil cryptphil merged commit 1c768fd into hyperledger-labs:main Aug 12, 2022
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