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

Add SC calls handling for ETH->MvX #267

Merged
merged 19 commits into from
Dec 14, 2023
Merged

Conversation

ccorcoveanu
Copy link
Contributor

@ccorcoveanu ccorcoveanu commented Nov 28, 2023

The flow should be as follows:

Since ETH contracts are non-upgradable we introduced a new proxy contract in front of the SafeContract.
This contract emits an event with some metadata we need for smart contract execution on MvX (tx data and gas limit + matching info like deposit and batch nonces) then forwards the deposit call to SafeContract.

clients/batch.go Outdated
return cloned
}

// SCBatch -
Copy link
Contributor

Choose a reason for hiding this comment

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

complete comments.

@@ -5,6 +5,8 @@ import (
"encoding/hex"
"errors"
"fmt"
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/ethclient"
Copy link
Contributor

Choose a reason for hiding this comment

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

goimports

@@ -2,6 +2,7 @@ package ethereum

import (
"context"
"github.com/ethereum/go-ethereum"
Copy link
Contributor

Choose a reason for hiding this comment

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

goimports

@@ -2,6 +2,7 @@ package wrappers

import (
"context"
"github.com/ethereum/go-ethereum"
Copy link
Contributor

Choose a reason for hiding this comment

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

goimports

"context"
"crypto/ecdsa"
"fmt"
"github.com/ethereum/go-ethereum"
"github.com/multiversx/mx-bridge-eth-go/clients/ethereum/contract"
Copy link
Contributor

Choose a reason for hiding this comment

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

goimports

return GettingPendingBatchFromEthereum
}

actionID, err := step.bridge.GetAndStoreActionIDForProposeSCTransferOnMultiversX(ctx)
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need new steps of 6 and 7 ? all the SC execution should be in parallel to this state-machine.

We would need a separate process where small bots are monitoring the SC which can forward call for executions.

Copy link
Contributor

@iulianpascalau iulianpascalau left a comment

Choose a reason for hiding this comment

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

will evaluate in the upcoming PR if we need more decoupling on the eth components

bridges/ethMultiversX/interface.go Outdated Show resolved Hide resolved
clients/batch.go Outdated Show resolved Hide resolved
clients/ethereum/client.go Outdated Show resolved Hide resolved
clients/ethereum/client.go Show resolved Hide resolved
clients/ethereum/client_test.go Outdated Show resolved Hide resolved
testsCommon/bridge/ethereumClientStub.go Outdated Show resolved Hide resolved
testsCommon/bridge/ethereumClientStub.go Show resolved Hide resolved
testsCommon/bridge/ethereumClientWrapperStub.go Outdated Show resolved Hide resolved
testsCommon/bridge/scExecProxyContractStub.go Show resolved Hide resolved
testsCommon/interactors/blockchainClientStub.go Outdated Show resolved Hide resolved
sasurobert
sasurobert previously approved these changes Dec 12, 2023
iulianpascalau
iulianpascalau previously approved these changes Dec 13, 2023
@ccorcoveanu ccorcoveanu marked this pull request as ready for review December 13, 2023 11:47
@iulianpascalau iulianpascalau merged commit 81152ae into feat/sc-execution Dec 14, 2023
3 checks passed
@iulianpascalau iulianpascalau deleted the sc-exec-impl branch December 14, 2023 10:17
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.

3 participants