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 backend #19

Merged
merged 16 commits into from
Jul 20, 2022
Merged

Multi backend #19

merged 16 commits into from
Jul 20, 2022

Conversation

cryptphil
Copy link
Member

@cryptphil cryptphil commented Jul 11, 2022

This PR implements the functionality to allow having multiple Ethereum backends.
For that, among other changes, assets need to be identified across different backends using their chainID.

Signed-off-by: Philipp-Florens Lehwalder <philipp@perun.network>
Signed-off-by: Philipp-Florens Lehwalder <philipp@perun.network>
Signed-off-by: Philipp-Florens Lehwalder <philipp@perun.network>
Signed-off-by: Philipp-Florens Lehwalder <philipp@perun.network>
Signed-off-by: Philipp-Florens Lehwalder <philipp@perun.network>
Is not feasible to use for multiledger tests.

Signed-off-by: Philipp-Florens Lehwalder <philipp@perun.network>
Signed-off-by: Philipp-Florens Lehwalder <philipp@perun.network>
Signed-off-by: Philipp-Florens Lehwalder <philipp@perun.network>
Signed-off-by: Philipp-Florens Lehwalder <philipp@perun.network>
Signed-off-by: Philipp-Florens Lehwalder <philipp@perun.network>
@cryptphil cryptphil force-pushed the multi-backend branch 2 times, most recently from d5bd1bf to 8316404 Compare July 15, 2022 13:01
Signed-off-by: Philipp-Florens Lehwalder <philipp@perun.network>
Signed-off-by: Philipp-Florens Lehwalder <philipp@perun.network>
Signed-off-by: Philipp-Florens Lehwalder <philipp@perun.network>
Copy link
Contributor

@matthiasgeihs matthiasgeihs left a comment

Choose a reason for hiding this comment

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

Looks good overall. Please see my comments for some questions and feedback.

@@ -54,14 +57,15 @@ type Adjudicator struct {

// NewAdjudicator creates a new ethereum adjudicator. The receiver is the
// on-chain address that receives withdrawals.
func NewAdjudicator(backend ContractBackend, contract common.Address, receiver common.Address, txSender accounts.Account) *Adjudicator {
func NewAdjudicator(backend ContractBackend, chainID ChainID, contract common.Address, receiver common.Address, txSender accounts.Account) *Adjudicator {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we read the chainID from the Contract Backend? This removes one point of error.

Copy link
Member Author

@cryptphil cryptphil Jul 18, 2022

Choose a reason for hiding this comment

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

Unfortunately, we cannot get the chainID only from the ContractBackend.

Copy link
Contributor

@matthiasgeihs matthiasgeihs Jul 19, 2022

Choose a reason for hiding this comment

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

OK, in this case I think we should add it. I added a respective commit. Please check if that looks good.

channel/adjudicator.go Outdated Show resolved Hide resolved
channel/asset.go Show resolved Hide resolved
channel/asset.go Outdated Show resolved Hide resolved
channel/asset.go Outdated Show resolved Hide resolved
channel/test/simulated.go Outdated Show resolved Hide resolved
channel/asset.go Outdated Show resolved Hide resolved
channel/asset.go Outdated Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
client/multiledger_happy_test.go Outdated Show resolved Hide resolved
Merge multiledger_happy_test.go & multiledger_dispute_test.go
Review comment: Update go-perun version
Review comment: Unexport FilterAssets, AssetIdx
Review comment: Add Signer for SimulatedBackend
Review comment: Update solc
Review comment: Rename vars in assetsToEthAssets
Review comment: Remove panic in AssetIDx
Review comment: Fix asset equal method
Review comment: Check for negative chainID when marshalling
Review comment: Fix doc

Signed-off-by: Philipp-Florens Lehwalder <philipp@perun.network>
Signed-off-by: Matthias Geihs <matthias@perun.network>
Signed-off-by: Matthias Geihs <matthias@perun.network>
Copy link
Contributor

@matthiasgeihs matthiasgeihs left a comment

Choose a reason for hiding this comment

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

Looks good.

I added two commits. One for slightly cleaning up the contractbackend file and one for adding ChainID to the backend.

Please have a look at my commits. If you are happy, I think we can merge.

@cryptphil
Copy link
Member Author

Looks good to me, I'll merge! 😄

@cryptphil cryptphil merged commit 202e7a4 into hyperledger-labs:main Jul 20, 2022
@cryptphil cryptphil deleted the multi-backend branch July 20, 2022 07:33
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