diff --git a/.github/workflows/beekeeper.yml b/.github/workflows/beekeeper.yml index 2c5541599d6..3b5a5d592a6 100644 --- a/.github/workflows/beekeeper.yml +++ b/.github/workflows/beekeeper.yml @@ -11,13 +11,13 @@ env: K3S_VERSION: "v1.22.17+k3s1" REPLICA: 3 RUN_TYPE: "PR RUN" - SETUP_CONTRACT_IMAGE_TAG: "2.0.1" + SETUP_CONTRACT_IMAGE_TAG: "2.0.3" BEELOCAL_BRANCH: "main" BEEKEEPER_BRANCH: "master" BEEKEEPER_METRICS_ENABLED: false REACHABILITY_OVERRIDE_PUBLIC: true BATCHFACTOR_OVERRIDE_PUBLIC: 2 - TIMEOUT: 30m + TIMEOUT: 2m BUCKET_NAME: swarm-beekeeper-artifacts AWS_ACCESS_KEY_ID: ${{ secrets.DO_AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.DO_AWS_SECRET_ACCESS_KEY }} diff --git a/pkg/settlement/swap/chequebook/factory.go b/pkg/settlement/swap/chequebook/factory.go index e1cb19e8ea6..fcab775f8f3 100644 --- a/pkg/settlement/swap/chequebook/factory.go +++ b/pkg/settlement/swap/chequebook/factory.go @@ -12,6 +12,7 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" + "github.com/ethersphere/bee/pkg/log" "github.com/ethersphere/bee/pkg/sctx" "github.com/ethersphere/bee/pkg/transaction" "github.com/ethersphere/bee/pkg/util/abiutil" @@ -54,12 +55,11 @@ type simpleSwapDeployedEvent struct { } // the bytecode of factories which can be used for deployment -var currentDeployVersion []byte = common.FromHex(sw3abi.SimpleSwapFactoryDeployedBinv0_5_4) +var currentDeployVersion = common.FromHex(sw3abi.SimpleSwapFactoryDeployedBinv0_5_4) // the bytecode of factories from which we accept chequebooks var supportedVersions = [][]byte{ currentDeployVersion, - common.FromHex(sw3abi.SimpleSwapFactoryDeployedBinv0_3_1), } // NewFactory creates a new factory service for the provided factory contract. @@ -114,30 +114,33 @@ func (c *factory) WaitDeployed(ctx context.Context, txHash common.Hash) (common. // VerifyBytecode checks that the factory is valid. func (c *factory) VerifyBytecode(ctx context.Context) (err error) { + logger := log.NewLogger("node").WithName("chequebook-factory").Register() code, err := c.backend.CodeAt(ctx, c.address, nil) if err != nil { return err } + logger.Info("factory code", "code_len", len(code)) if !bytes.Equal(code, currentDeployVersion) { return ErrInvalidFactory } -LOOP: - for _, factoryAddress := range c.legacyAddresses { - code, err := c.backend.CodeAt(ctx, factoryAddress, nil) - if err != nil { - return err - } - - for _, referenceCode := range supportedVersions { - if bytes.Equal(code, referenceCode) { - continue LOOP - } - } - - return fmt.Errorf("failed to find matching bytecode for factory %x: %w", factoryAddress, ErrInvalidFactory) - } + // logger.Info("checking legacy factory code", "legacy_addresses", c.legacyAddresses) + //LOOP: + // for _, factoryAddress := range c.legacyAddresses { + // code, err := c.backend.CodeAt(ctx, factoryAddress, nil) + // if err != nil { + // return err + // } + // + // for _, referenceCode := range supportedVersions { + // if bytes.Equal(code, referenceCode) { + // continue LOOP + // } + // } + // + // return fmt.Errorf("failed to find matching bytecode for factory %x: %w", factoryAddress, ErrInvalidFactory) + // } return nil } diff --git a/pkg/settlement/swap/chequebook/init.go b/pkg/settlement/swap/chequebook/init.go index b8b21f154bb..ba3f44785e5 100644 --- a/pkg/settlement/swap/chequebook/init.go +++ b/pkg/settlement/swap/chequebook/init.go @@ -164,6 +164,7 @@ func Init( return nil, err } + logger.Info("deploying...", "tx", txHash) // if we don't yet have a chequebook, deploy a new one txHash, err = chequebookFactory.Deploy(ctx, overlayEthAddress, big.NewInt(0), common.BytesToHash(nonce)) if err != nil {