Skip to content

Commit

Permalink
Revert "feat: switch to the sepolia testnet (#4465) (#4500)"
Browse files Browse the repository at this point in the history
This reverts commit 4532f79.
  • Loading branch information
istae committed Feb 8, 2024
1 parent 9e77bd8 commit 10cbaf0
Show file tree
Hide file tree
Showing 19 changed files with 34 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/beekeeper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:
K3S_VERSION: "v1.22.17+k3s1"
REPLICA: 3
RUN_TYPE: "PR RUN"
SETUP_CONTRACT_IMAGE_TAG: "2.0.7"
SETUP_CONTRACT_IMAGE_TAG: "1.0.4"
BEELOCAL_BRANCH: "main"
BEEKEEPER_BRANCH: "master"
BEEKEEPER_METRICS_ENABLED: false
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ require (
github.com/casbin/casbin/v2 v2.35.0
github.com/coreos/go-semver v0.3.0
github.com/ethereum/go-ethereum v1.13.4
github.com/ethersphere/go-price-oracle-abi v0.2.0
github.com/ethersphere/go-storage-incentives-abi v0.6.2
github.com/ethersphere/go-sw3-abi v0.6.5
github.com/ethersphere/go-price-oracle-abi v0.1.0
github.com/ethersphere/go-storage-incentives-abi v0.6.0
github.com/ethersphere/go-sw3-abi v0.4.0
github.com/ethersphere/langos v1.0.0
github.com/go-playground/validator/v10 v10.11.1
github.com/gogo/protobuf v1.3.2
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,12 @@ github.com/ethereum/c-kzg-4844 v0.3.1/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1
github.com/ethereum/go-ethereum v1.10.4/go.mod h1:nEE0TP5MtxGzOMd7egIrbPJMQBnhVU3ELNxhBglIzhg=
github.com/ethereum/go-ethereum v1.13.4 h1:25HJnaWVg3q1O7Z62LaaI6S9wVq8QCw3K88g8wEzrcM=
github.com/ethereum/go-ethereum v1.13.4/go.mod h1:I0U5VewuuTzvBtVzKo7b3hJzDhXOUtn9mJW7SsIPB0Q=
github.com/ethersphere/go-price-oracle-abi v0.2.0 h1:wtIcYLgNZHY4BjYwJCnu93SvJdVAZVvBaKinspyyHvQ=
github.com/ethersphere/go-price-oracle-abi v0.2.0/go.mod h1:sI/Qj4/zJ23/b1enzwMMv0/hLTpPNVNacEwCWjo6yBk=
github.com/ethersphere/go-storage-incentives-abi v0.6.2 h1:lcVylu+KRUEOUvytP6ofcyTwTE7UmfE2oJPC4jpVjSo=
github.com/ethersphere/go-storage-incentives-abi v0.6.2/go.mod h1:SXvJVtM4sEsaSKD0jc1ClpDLw8ErPoROZDme4Wrc/Nc=
github.com/ethersphere/go-sw3-abi v0.6.5 h1:M5dcIe1zQYvGpY2K07UNkNU9Obc4U+A1fz68Ho/Q+XE=
github.com/ethersphere/go-sw3-abi v0.6.5/go.mod h1:BmpsvJ8idQZdYEtWnvxA8POYQ8Rl/NhyCdF0zLMOOJU=
github.com/ethersphere/go-price-oracle-abi v0.1.0 h1:yg/hK8nETNvk+GEBASlbakMFv/CVp7HXiycrHw1pRV8=
github.com/ethersphere/go-price-oracle-abi v0.1.0/go.mod h1:sI/Qj4/zJ23/b1enzwMMv0/hLTpPNVNacEwCWjo6yBk=
github.com/ethersphere/go-storage-incentives-abi v0.6.0 h1:lfGViU/wJg/CyXlntNvTQpqQ2A4QYGLJ7jo+Pw+H+a4=
github.com/ethersphere/go-storage-incentives-abi v0.6.0/go.mod h1:SXvJVtM4sEsaSKD0jc1ClpDLw8ErPoROZDme4Wrc/Nc=
github.com/ethersphere/go-sw3-abi v0.4.0 h1:T3ANY+ktWrPAwe2U0tZi+DILpkHzto5ym/XwV/Bbz8g=
github.com/ethersphere/go-sw3-abi v0.4.0/go.mod h1:BmpsvJ8idQZdYEtWnvxA8POYQ8Rl/NhyCdF0zLMOOJU=
github.com/ethersphere/langos v1.0.0 h1:NBtNKzXTTRSue95uOlzPN4py7Aofs0xWPzyj4AI1Vcc=
github.com/ethersphere/langos v1.0.0/go.mod h1:dlcN2j4O8sQ+BlCaxeBu43bgr4RQ+inJ+pHwLeZg5Tw=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
Expand Down
4 changes: 2 additions & 2 deletions packaging/docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Set all configuration variables inside `.env`
If you want to run node in full mode, set `BEE_FULL_NODE=true`

Bee requires an Ethereum endpoint to function. Obtain a free Infura account and set:
- `BEE_BLOCKCHAIN_RPC_ENDPOINT=wss://sepolia.infura.io/ws/v3/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`
- `BEE_BLOCKCHAIN_RPC_ENDPOINT=wss://goerli.infura.io/ws/v3/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`

Set bee password by either setting `BEE_PASSWORD` or `BEE_PASSWORD_FILE`

Expand All @@ -30,7 +30,7 @@ Start it with
docker-compose up -d
```

From logs find URL line with `on sepolia you can get both sepolia eth and sepolia bzz from` and prefund your node
From logs find URL line with `on goerli you can get both goerli eth and goerli bzz from` and prefund your node
```
docker-compose logs -f bee-1
```
Expand Down
9 changes: 6 additions & 3 deletions pkg/config/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,16 @@ var (
NetworkID: abi.TestnetNetworkID,
PostageStampStartBlock: abi.TestnetPostageStampBlockNumber,
NativeTokenSymbol: "ETH",
SwarmTokenSymbol: "sBZZ",
SwarmTokenSymbol: "gBZZ",

StakingAddress: common.HexToAddress(abi.TestnetStakingAddress),
PostageStampAddress: common.HexToAddress(abi.TestnetPostageStampAddress),
RedistributionAddress: common.HexToAddress(abi.TestnetRedistributionAddress),
SwapPriceOracleAddress: common.HexToAddress("0xe821533d30A4250e50812Aa060EEb2E8Ef3D98f6"),
CurrentFactoryAddress: common.HexToAddress("0x0fF044F6bB4F684a5A149B46D7eC03ea659F98A1"),
SwapPriceOracleAddress: common.HexToAddress("0x0c9de531dcb38b758fe8a2c163444a5e54ee0db2"),
CurrentFactoryAddress: common.HexToAddress("0x73c412512E1cA0be3b89b77aB3466dA6A1B9d273"),
LegacyFactoryAddresses: []common.Address{
common.HexToAddress("0xf0277caffea72734853b834afc9892461ea18474"),
},

StakingABI: abi.TestnetStakingABI,
PostageStampABI: abi.TestnetPostageStampABI,
Expand Down
4 changes: 2 additions & 2 deletions pkg/node/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func InitChain(
var versionString string
err = rpcClient.CallContext(ctx, &versionString, "web3_clientVersion")
if err != nil {
logger.Info("could not connect to backend; in a swap-enabled network a working blockchain node (for xdai network in production, sepolia in testnet) is required; check your node or specify another node using --swap-endpoint.", "backend_endpoint", endpoint)
logger.Info("could not connect to backend; in a swap-enabled network a working blockchain node (for xdai network in production, goerli in testnet) is required; check your node or specify another node using --swap-endpoint.", "backend_endpoint", endpoint)
return nil, common.Address{}, 0, nil, nil, fmt.Errorf("blockchain client get version: %w", err)
}

Expand Down Expand Up @@ -356,7 +356,7 @@ func (m noOpChainBackend) Metrics() []prometheus.Collector {
}

func (m noOpChainBackend) CodeAt(context.Context, common.Address, *big.Int) ([]byte, error) {
return common.FromHex(sw3abi.SimpleSwapFactoryDeployedBinv0_6_5), nil
return common.FromHex(sw3abi.SimpleSwapFactoryDeployedBinv0_4_0), nil
}
func (m noOpChainBackend) CallContract(context.Context, ethereum.CallMsg, *big.Int) ([]byte, error) {
return nil, errors.New("disabled chain backend")
Expand Down
2 changes: 1 addition & 1 deletion pkg/postage/postagecontract/contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
var (
BucketDepth = uint8(16)

erc20ABI = abiutil.MustParseABI(sw3abi.ERC20ABIv0_6_5)
erc20ABI = abiutil.MustParseABI(sw3abi.ERC20ABIv0_3_1)

ErrBatchCreate = errors.New("batch creation failed")
ErrInsufficientFunds = errors.New("insufficient token balance")
Expand Down
2 changes: 1 addition & 1 deletion pkg/resolver/client/ens/ens_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (

func TestENSIntegration(t *testing.T) {
// TODO: consider using a stable gateway instead of INFURA.
defaultEndpoint := "https://sepolia.infura.io/v3/59d83a5a4be74f86b9851190c802297b"
defaultEndpoint := "https://goerli.infura.io/v3/59d83a5a4be74f86b9851190c802297b"
defaultAddr := swarm.MustParseHexAddress("00cb23598c2e520b6a6aae3ddc94fed4435a2909690bdd709bf9d9e7c2aadfad")

testCases := []struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/settlement/swap/chequebook/cashout_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
)

var (
chequebookABI = abiutil.MustParseABI(sw3abi.ERC20SimpleSwapABIv0_6_5)
chequebookABI = abiutil.MustParseABI(sw3abi.ERC20SimpleSwapABIv0_3_1)
chequeCashedEventType = chequebookABI.Events["ChequeCashed"]
chequeBouncedEventType = chequebookABI.Events["ChequeBounced"]
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/settlement/swap/chequebook/chequebook.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var (
// ErrInsufficientFunds is the error when the chequebook has not enough free funds for a user action
ErrInsufficientFunds = errors.New("insufficient token balance")

chequebookABI = abiutil.MustParseABI(sw3abi.ERC20SimpleSwapABIv0_6_5)
chequebookABI = abiutil.MustParseABI(sw3abi.ERC20SimpleSwapABIv0_3_1)
chequeCashedEventType = chequebookABI.Events["ChequeCashed"]
chequeBouncedEventType = chequebookABI.Events["ChequeBounced"]
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/settlement/swap/chequebook/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var (
ErrNotDeployedByFactory = errors.New("chequebook not deployed by factory")
errDecodeABI = errors.New("could not decode abi data")

factoryABI = abiutil.MustParseABI(sw3abi.SimpleSwapFactoryABIv0_6_5)
factoryABI = abiutil.MustParseABI(sw3abi.SimpleSwapFactoryABIv0_4_0)
simpleSwapDeployedEventType = factoryABI.Events["SimpleSwapDeployed"]
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/settlement/swap/chequebook/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
)

var (
factoryABI = abiutil.MustParseABI(sw3abi.SimpleSwapFactoryABIv0_6_5)
factoryABI = abiutil.MustParseABI(sw3abi.SimpleSwapFactoryABIv0_4_0)
simpleSwapDeployedEvent = factoryABI.Events["SimpleSwapDeployed"]
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/settlement/swap/erc20/erc20.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
)

var (
erc20ABI = abiutil.MustParseABI(sw3abi.ERC20ABIv0_6_5)
erc20ABI = abiutil.MustParseABI(sw3abi.ERC20ABIv0_3_1)
errDecodeABI = errors.New("could not decode abi data")
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/settlement/swap/erc20/erc20_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
)

var (
erc20ABI = abiutil.MustParseABI(sw3abi.ERC20ABIv0_6_5)
erc20ABI = abiutil.MustParseABI(sw3abi.ERC20ABIv0_3_1)
)

func TestBalanceOf(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/settlement/swap/priceoracle/priceoracle.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ type Service interface {
}

var (
priceOracleABI = abiutil.MustParseABI(priceoracleabi.PriceOracleABIv0_2_0)
priceOracleABI = abiutil.MustParseABI(priceoracleabi.PriceOracleABIv0_1_0)
)

func New(logger log.Logger, priceOracleAddress common.Address, transactionService transaction.Service, timeDivisor int64) Service {
Expand Down
2 changes: 1 addition & 1 deletion pkg/settlement/swap/priceoracle/priceoracle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
)

var (
priceOracleABI = abiutil.MustParseABI(priceoracleabi.PriceOracleABIv0_2_0)
priceOracleABI = abiutil.MustParseABI(priceoracleabi.PriceOracleABIv0_1_0)
)

func TestExchangeGetPrice(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/storageincentives/staking/contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
var (
MinimumStakeAmount = big.NewInt(100000000000000000)

erc20ABI = abiutil.MustParseABI(sw3abi.ERC20ABIv0_6_5)
erc20ABI = abiutil.MustParseABI(sw3abi.ERC20ABIv0_3_1)

ErrInsufficientStakeAmount = errors.New("insufficient stake amount")
ErrInsufficientFunds = errors.New("insufficient token balance")
Expand Down
2 changes: 1 addition & 1 deletion pkg/transaction/event_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
)

var (
erc20ABI = abiutil.MustParseABI(sw3abi.ERC20ABIv0_6_5)
erc20ABI = abiutil.MustParseABI(sw3abi.ERC20ABIv0_3_1)
)

type transferEvent struct {
Expand Down
4 changes: 2 additions & 2 deletions pkg/transaction/transaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -935,12 +935,12 @@ func TestTransactionService_UnwrapABIError(t *testing.T) {
txData = common.Hex2Bytes("0xabcdee")
value = big.NewInt(1)

// This is the ABI of the following contract: https://sepolia.etherscan.io/address/0xd29d9e385f19d888557cd609006bb1934cb5d1e2#code
// This is the ABI of the following contract: https://goerli.etherscan.io/address/0xd29d9e385f19d888557cd609006bb1934cb5d1e2#code
contractABI = abiutil.MustParseABI(`[{"inputs":[{"internalType":"uint256","name":"available","type":"uint256"},{"internalType":"uint256","name":"required","type":"uint256"}],"name":"InsufficientBalance","type":"error"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[],"stateMutability":"nonpayable","type":"function"}]`)
rpcAPIErr = &rpcAPIError{
code: 3,
msg: "execution reverted",
err: "0xcf4791810000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006f", // This is the ABI encoded error form the following failed transaction: https://sepolia.etherscan.io/tx/0x74a2577db1c325c41e38977aa1eb32ab03dfa17cc1fa0649e84f3d8c0f0882ee
err: "0xcf4791810000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006f", // This is the ABI encoded error form the following failed transaction: https://goerli.etherscan.io/tx/0x74a2577db1c325c41e38977aa1eb32ab03dfa17cc1fa0649e84f3d8c0f0882ee
}
)

Expand Down

0 comments on commit 10cbaf0

Please sign in to comment.