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

feat: Inbound / outbound peers & default seeds #541

Merged
merged 9 commits into from
May 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -51,6 +51,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
### Improvements

- (cmd) [\#543](https://github.com/tharsis/evmos/pull/543) Update mainnet default `min-gas-price` to `0.0025aevmos`.
- (p2p) [\#541](https://github.com/tharsis/evmos/pull/541) Increase default inbound connections and use 8:1 ratio of inbound:outbound. Add default seeds to reduce the need for configuration.
- (epochs) [\#539](https://github.com/tharsis/evmos/pull/539) Use constants for epoch identifiers.
- (deps) [\#528](https://github.com/tharsis/evmos/pull/528) Bump Cosmos SDK to [`v0.45.4`](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.4)

13 changes: 12 additions & 1 deletion cmd/evmosd/init.go
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ import (
"fmt"
"os"
"path/filepath"
"strings"
"time"

"github.com/pkg/errors"
@@ -76,8 +77,18 @@ func InitCmd(mbm module.BasicManager, defaultNodeHome string) *cobra.Command {
config := serverCtx.Config
config.SetRoot(clientCtx.HomeDir)

config.P2P.MaxNumInboundPeers = 100
// Set peers in and out to an 8:1 ratio to prevent choking
config.P2P.MaxNumInboundPeers = 240
config.P2P.MaxNumOutboundPeers = 30

// Set default seeds
seeds := []string{
"40f4fac63da8b1ce8f850b0fa0f79b2699d2ce72@seed.evmos.jerrychong.com:26656", // jerrychong
"e3e11fca4ecf4035a751f3fea90e3a821e274487@bd-evmos-mainnet-seed-node-01.bdnodes.net:26656", // blockdaemon
"fc86e7e75c5d2e4699535e1b1bec98ae55b16826@bd-evmos-mainnet-seed-node-02.bdnodes.net:26656", // blockdaemon
}
config.P2P.Seeds = strings.Join(seeds, ",")

config.Mempool.Size = 10000
config.StateSync.TrustPeriod = 112 * time.Hour

6 changes: 0 additions & 6 deletions x/erc20/keeper/evm_hooks_test.go
Original file line number Diff line number Diff line change
@@ -81,7 +81,6 @@ func (suite *KeeperTestSuite) TestEvmHooksRegisterERC20() {

// Burn the 10 tokens of suite.address (owner)
_ = suite.BurnERC20Token(contractAddr, suite.address, big.NewInt(10))

},
false,
},
@@ -101,13 +100,11 @@ func (suite *KeeperTestSuite) TestEvmHooksRegisterERC20() {

// Burn the 10 tokens of suite.address (owner)
_ = suite.BurnERC20Token(contractAddr, suite.address, big.NewInt(10))

},
false,
},
}
for _, tc := range testCases {

suite.Run(fmt.Sprintf("Case %s", tc.name), func() {
suite.mintFeeCollector = true
suite.SetupTest()
@@ -200,7 +197,6 @@ func (suite *KeeperTestSuite) TestEvmHooksRegisterCoin() {
}

func (suite *KeeperTestSuite) TestEvmHooksForceError() {

msg := ethtypes.NewMessage(
types.ModuleAddress,
&common.Address{},
@@ -281,7 +277,6 @@ func (suite *KeeperTestSuite) TestEvmHooksForceError() {

tokens, _ := transferEvent[0].(*big.Int)
suite.Require().Equal(cosmosBalance.Amount.String(), tokens.String())

},
},
{
@@ -438,7 +433,6 @@ func (suite *KeeperTestSuite) TestEvmHooksForceError() {
suite.ensureHooksSet()

tc.test()

})
}
suite.mintFeeCollector = false
1 change: 0 additions & 1 deletion x/erc20/keeper/integration_test.go
Original file line number Diff line number Diff line change
@@ -6,7 +6,6 @@ import (
)

var _ = Describe("Performing EVM transactions", Ordered, func() {

BeforeEach(func() {
s.SetupTest()

4 changes: 0 additions & 4 deletions x/recovery/keeper/ibc_callbacks_integration_test.go
Original file line number Diff line number Diff line change
@@ -52,7 +52,6 @@ var _ = Describe("Recovery: Performing an IBC Transfer", Ordered, func() {
})

Describe("from an authorized, non-EVM chain (e.g. Osmosis)", func() {

Describe("to a different account on Evmos (sender != recipient)", func() {
BeforeEach(func() {
sender = s.IBCOsmosisChain.SenderAccount.GetAddress().String()
@@ -174,7 +173,6 @@ var _ = Describe("Recovery: Performing an IBC Transfer", Ordered, func() {

Context("without a sender's claims record", func() {
When("recipient has no ibc vouchers that originated from other chains", func() {

It("should transfer and recover tokens", func() {
// aevmos & ibc tokens that originated from the sender's chain
s.SendAndReceiveMessage(s.pathOsmosisEvmos, s.IBCOsmosisChain, coinOsmo.Denom, coinOsmo.Amount.Int64(), sender, receiver, 1)
@@ -218,7 +216,6 @@ var _ = Describe("Recovery: Performing an IBC Transfer", Ordered, func() {

params.EnableRecovery = true
s.EvmosChain.App.(*app.Evmos).RecoveryKeeper.SetParams(s.EvmosChain.GetContext(), params)

})
It("should not recover tokens that originated from other chains", func() {
// Send uosmo from Osmosis to Evmos
@@ -295,7 +292,6 @@ var _ = Describe("Recovery: Performing an IBC Transfer", Ordered, func() {

params.EnableRecovery = true
s.EvmosChain.App.(*app.Evmos).RecoveryKeeper.SetParams(s.EvmosChain.GetContext(), params)

})
It("should not recover tokens that originated from other chains", func() {
s.SendAndReceiveMessage(s.pathOsmosisEvmos, s.IBCOsmosisChain, "uosmo", 10, sender, receiver, 2)
2 changes: 0 additions & 2 deletions x/recovery/keeper/ibc_callbacks_test.go
Original file line number Diff line number Diff line change
@@ -401,7 +401,6 @@ func (suite *KeeperTestSuite) TestGetIBCDenomDestinationIdentifiers() {
Counterparty: channeltypes.NewCounterparty("t", "channel-292"),
}
suite.app.IBCKeeper.ChannelKeeper.SetChannel(suite.ctx, "t", "channel-3", channel)

},
true,
"", "",
@@ -420,7 +419,6 @@ func (suite *KeeperTestSuite) TestGetIBCDenomDestinationIdentifiers() {
Counterparty: channeltypes.NewCounterparty("transfer", "channel-292"),
}
suite.app.IBCKeeper.ChannelKeeper.SetChannel(suite.ctx, "transfer", "c-3", channel)

},
true,
"", "",