Skip to content

Commit

Permalink
[TT-1151] use latest stable version of evm node implementations (#954)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tofel authored May 17, 2024
1 parent 3794fe7 commit 3083a59
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 11 deletions.
3 changes: 2 additions & 1 deletion docker/test_env/besu_base.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (

const (
defaultBesuEth1Image = "hyperledger/besu:22.1.0"
defaultBesuEth2Image = "hyperledger/besu:24.1.0"
defaultBesuEth2Image = "hyperledger/besu:24.5.1"
besuBaseImageName = "hyperledger/besu"
besuGitRepo = "hyperledger/besu"
)
Expand Down Expand Up @@ -116,6 +116,7 @@ func (g *Besu) StartContainer() (blockchain.EVMNetwork, error) {
networkConfig.URLs = []string{g.ExternalWsUrl}
networkConfig.HTTPURLs = []string{g.ExternalHttpUrl}
networkConfig.GasEstimationBuffer = 10_000_000_000
networkConfig.SimulationType = "Besu"

if g.GetEthereumVersion() == config.EthereumVersion_Eth1 {
networkConfig.Name = fmt.Sprintf("Private Eth-1-PoA [besu %s]", g.ContainerVersion)
Expand Down
3 changes: 2 additions & 1 deletion docker/test_env/besu_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ func TestBesuEth2(t *testing.T) {
eip1559Network.SupportsEIP1559 = true
eip1559Network.URLs = eth2.PublicWsUrls()
_, err = blockchain.ConnectEVMClient(eip1559Network, l)
require.Error(t, err, "Could connect to the evm client")
require.Error(t, err, "Could not connect to Besu")
require.Contains(t, err.Error(), "Method not found", "Besu should not work EIP-1559 yet")

}
3 changes: 2 additions & 1 deletion docker/test_env/erigon_base.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (

const (
defaultErigonEth1Image = "thorax/erigon:v2.40.0"
defaultErigonEth2Image = "thorax/erigon:v2.56.2"
defaultErigonEth2Image = "thorax/erigon:v2.59.3" // v.2.60.0 is the latest, but gas estimations using zero address are broken
erigonBaseImageName = "thorax/erigon"
erigonGitRepo = "ledgerwatch/erigon"
)
Expand Down Expand Up @@ -102,6 +102,7 @@ func (g *Erigon) StartContainer() (blockchain.EVMNetwork, error) {
}
networkConfig.URLs = []string{g.ExternalWsUrl}
networkConfig.HTTPURLs = []string{g.ExternalHttpUrl}
networkConfig.SimulationType = "Erigon"

g.l.Info().Str("containerName", g.ContainerName).
Msg("Started Erigon container")
Expand Down
3 changes: 2 additions & 1 deletion docker/test_env/geth_base.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (

const (
defaultGethEth1Image = "ethereum/client-go:v1.12.0"
defaultGethEth2Image = "ethereum/client-go:v1.13.10"
defaultGethEth2Image = "ethereum/client-go:v1.14.3"
gethBaseImageName = "ethereum/client-go"
gethGitRepo = "ethereum/go-ethereum"
)
Expand Down Expand Up @@ -105,6 +105,7 @@ func (g *Geth) StartContainer() (blockchain.EVMNetwork, error) {
}
networkConfig.URLs = []string{g.ExternalWsUrl}
networkConfig.HTTPURLs = []string{g.ExternalHttpUrl}
networkConfig.SimulationType = "Geth"

comparableVersion, err := GetComparableVersionFromDockerImage(g.GetImageWithVersion())
if err != nil {
Expand Down
3 changes: 2 additions & 1 deletion docker/test_env/nethermind_base.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

const (
defaultNethermindEth1Image = "nethermind/nethermind:1.16.0"
defaultNethermindEth2Image = "nethermind/nethermind:1.25.1"
defaultNethermindEth2Image = "nethermind/nethermind:1.26.0"
nethermindBaseImageName = "nethermind/nethermind"
nethermindGitRepo = "NethermindEth/nethermind"
)
Expand Down Expand Up @@ -107,6 +107,7 @@ func (g *Nethermind) StartContainer() (blockchain.EVMNetwork, error) {
}
networkConfig.URLs = []string{g.ExternalWsUrl}
networkConfig.HTTPURLs = []string{g.ExternalHttpUrl}
networkConfig.SimulationType = "Nethermind"

g.l.Info().Str("containerName", g.ContainerName).
Msg("Started Nethermind container")
Expand Down
15 changes: 9 additions & 6 deletions docker/test_env/test_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,16 @@ func sendAndCompareBalances(ctx context.Context, c blockchain.EVMClient, address
}

toSendEth := big.NewFloat(1)

exp := new(big.Int).Exp(big.NewInt(10), big.NewInt(18), nil)
toSendEthInt := new(big.Int)
_, _ = toSendEth.Int(toSendEthInt)
sentInWei := new(big.Int).Mul(toSendEthInt, exp)

gasEstimations, err := c.EstimateGas(ethereum.CallMsg{
To: &address,
From: common.HexToAddress(c.GetDefaultWallet().Address()),
To: &address,
Value: sentInWei,
})
if err != nil {
return err
Expand All @@ -34,11 +42,6 @@ func sendAndCompareBalances(ctx context.Context, c blockchain.EVMClient, address
return err
}

exp := new(big.Int).Exp(big.NewInt(10), big.NewInt(18), nil)
toSendEthInt := new(big.Int)
_, _ = toSendEth.Int(toSendEthInt)
sentInWei := new(big.Int).Mul(toSendEthInt, exp)

expected := big.NewInt(0).Add(balanceBefore, sentInWei)

if expected.Cmp(balanceAfter) != 0 {
Expand Down

0 comments on commit 3083a59

Please sign in to comment.