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
Show file tree
Hide file tree
Changes from 6 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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
- [\#536](https://github.com/tharsis/evmos/pull/536) Rename inflation endpoint `/evmos/inflation/v1/total_supply` -> `/evmos/inflation/v1/circulating_supply`

### Improvements

- (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.
- (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)

### Bug Fixes
Expand Down
6 changes: 2 additions & 4 deletions client/docs/statik/statik.go

Large diffs are not rendered by default.

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

"github.com/pkg/errors"
Expand Down Expand Up @@ -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

Expand Down
122 changes: 122 additions & 0 deletions go.sum

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions x/erc20/keeper/evm_hooks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand All @@ -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()
Expand Down Expand Up @@ -200,7 +197,6 @@ func (suite *KeeperTestSuite) TestEvmHooksRegisterCoin() {
}

func (suite *KeeperTestSuite) TestEvmHooksForceError() {

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

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

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

tc.test()

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

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

BeforeEach(func() {
s.SetupTest()

Expand Down
10 changes: 6 additions & 4 deletions x/erc20/types/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ func TestSanitizeERC20Name(t *testing.T) {
}

func TestEqualMetadata(t *testing.T) {

base := "CoinBase"
display := "CoinDisplay"
name := "CoinName"
Expand All @@ -47,7 +46,8 @@ func TestEqualMetadata(t *testing.T) {
Denom: display,
Exponent: decimal,
Aliases: []string{display, "moreInfo"},
}}
},
}
metadata_A := banktypes.Metadata{
Base: base,
Display: display,
Expand All @@ -68,7 +68,8 @@ func TestEqualMetadata(t *testing.T) {
Denom: display,
Exponent: decimal,
Aliases: []string{display, "moreInfo"},
}}
},
}
metadata_B := banktypes.Metadata{
Base: base,
Display: display,
Expand All @@ -89,7 +90,8 @@ func TestEqualMetadata(t *testing.T) {
Denom: display,
Exponent: decimal,
Aliases: []string{display, "moreInfo"},
}}
},
}
metadata_C := banktypes.Metadata{
Base: base,
Display: display,
Expand Down
4 changes: 0 additions & 4 deletions x/recovery/keeper/ibc_callbacks_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions x/recovery/keeper/ibc_callbacks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
"", "",
Expand All @@ -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,
"", "",
Expand Down