Skip to content

Commit

Permalink
commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Nimrostafarian committed Dec 29, 2022
1 parent 07f4c23 commit f46e847
Show file tree
Hide file tree
Showing 194 changed files with 2,132 additions and 2,132 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ This version mitigates a memory leak in tendermint that was found prior to launc

### Bugfix

The default tendermint pruning strategy, `pruning="syncable"` is currently unsafe due to a [memory leak](https://github.com/tendermint/iavl/issues/256) that can cause irrecoverable data loss. This patch release prevents `kvd` from being started with the `pruning="syncable"` configuration. Until a patch for tendermint is released, the ONLY pruning strategies that are safe to run are `everything` (an archival node) or `nothing` (only the most recent state is kept). It is strongly recommended that validators use `pruning="nothing"` for mage-3. It is expected that a patch to tendermint will be released in a non-breaking manner and that nodes will be able to update seamlessly after the launch of mage-3.
The default tendermint pruning strategy, `pruning="syncable"` is currently unsafe due to a [memory leak](https://github.com/tendermint/iavl/issues/256) that can cause irrecoverable data loss. This patch release prevents `mgd` from being started with the `pruning="syncable"` configuration. Until a patch for tendermint is released, the ONLY pruning strategies that are safe to run are `everything` (an archival node) or `nothing` (only the most recent state is kept). It is strongly recommended that validators use `pruning="nothing"` for mage-3. It is expected that a patch to tendermint will be released in a non-breaking manner and that nodes will be able to update seamlessly after the launch of mage-3.

The steps for upgrading to mage-3 can be found [here](https://github.com/furya-official/mage/blob/v0.10.0/contrib/mage-3/migration.md). Please note the additional section on [pruning](https://github.com/furya-official/mage/blob/v0.10.0/contrib/mage-3/migration.md#Pruning).

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ build-docker-local-mage:

# Run a 4-node testnet locally
localnet-start: build-linux localnet-stop
@if ! [ -f build/node0/kvd/config/genesis.json ]; then docker run --rm -v $(CURDIR)/build:/kvd:Z furya-official/mageMagenode testnet --v 4 -o . --starting-ip-address 192.168.10.2 --keyring-backend=test ; fi
@if ! [ -f build/node0/mgd/config/genesis.json ]; then docker run --rm -v $(CURDIR)/build:/mgd:Z furya-official/mageMagenode testnet --v 4 -o . --starting-ip-address 192.168.10.2 --keyring-backend=test ; fi
docker-compose up -d

localnet-stop:
Expand Down Expand Up @@ -279,7 +279,7 @@ test:

# Run cli integration tests
# `-p 4` to use 4 cores, `-tags cli_test` to tell go not to ignore the cli package
# These tests use the `kvd` or `kvcli` binaries in the build dir, or in `$BUILDDIR` if that env var is set.
# These tests use the `mgd` or `kvcli` binaries in the build dir, or in `$BUILDDIR` if that env var is set.
test-cli: build
@go test ./cli_test -tags cli_test -v -p 4

Expand Down
4 changes: 2 additions & 2 deletions app/_simulate_tx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ func (suite *SimulateRequestTestSuite) TestSimulateRequest() {
bank.MsgSend{
FromAddress: fromAddr,
ToAddress: toAddr,
Amount: sdk.NewCoins(sdk.NewCoin("uMage", sdk.NewInt(1e6))),
Amount: sdk.NewCoins(sdk.NewCoin("umage", sdk.NewInt(1e6))),
},
},
Fee: auth.StdFee{
Amount: sdk.NewCoins(sdk.NewCoin("uMage", sdk.NewInt(5e4))),
Amount: sdk.NewCoins(sdk.NewCoin("umage", sdk.NewInt(5e4))),
Gas: 1e6,
},
Memo: "test memo",
Expand Down
4 changes: 2 additions & 2 deletions app/ante/ante_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func TestAppAnteHandler_AuthorizedMempool(t *testing.T) {
chainID,
app.NewFundedGenStateWithSameCoins(
tApp.AppCodec(),
sdk.NewCoins(sdk.NewInt64Coin("uMage", 1e9)),
sdk.NewCoins(sdk.NewInt64Coin("umage", 1e9)),
testAddresses,
),
newBep3GenStateMulti(tApp.AppCodec(), deputy),
Expand Down Expand Up @@ -110,7 +110,7 @@ func TestAppAnteHandler_AuthorizedMempool(t *testing.T) {
banktypes.NewMsgSend(
tc.address,
testAddresses[0],
sdk.NewCoins(sdk.NewInt64Coin("uMage", 1_000_000)),
sdk.NewCoins(sdk.NewInt64Coin("umage", 1_000_000)),
),
},
sdk.NewCoins(), // no fee
Expand Down
8 changes: 4 additions & 4 deletions app/ante/authorized_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func TestAuthenticatedMempoolDecorator_AnteHandle_NotCheckTx(t *testing.T) {
banktypes.NewMsgSend(
testAddresses[0],
testAddresses[1],
sdk.NewCoins(sdk.NewInt64Coin("uMage", 100_000_000)),
sdk.NewCoins(sdk.NewInt64Coin("umage", 100_000_000)),
),
},
sdk.NewCoins(), // no fee
Expand Down Expand Up @@ -76,12 +76,12 @@ func TestAuthenticatedMempoolDecorator_AnteHandle_Pass(t *testing.T) {
banktypes.NewMsgSend(
testAddresses[0],
testAddresses[1],
sdk.NewCoins(sdk.NewInt64Coin("uMage", 100_000_000)),
sdk.NewCoins(sdk.NewInt64Coin("umage", 100_000_000)),
),
banktypes.NewMsgSend(
testAddresses[2],
testAddresses[1],
sdk.NewCoins(sdk.NewInt64Coin("uMage", 100_000_000)),
sdk.NewCoins(sdk.NewInt64Coin("umage", 100_000_000)),
),
},
sdk.NewCoins(), // no fee
Expand Down Expand Up @@ -116,7 +116,7 @@ func TestAuthenticatedMempoolDecorator_AnteHandle_Reject(t *testing.T) {
banktypes.NewMsgSend(
testAddresses[0],
testAddresses[1],
sdk.NewCoins(sdk.NewInt64Coin("uMage", 100_000_000)),
sdk.NewCoins(sdk.NewInt64Coin("umage", 100_000_000)),
),
},
sdk.NewCoins(), // no fee
Expand Down
6 changes: 3 additions & 3 deletions app/ante/authz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func TestAuthzLimiterDecorator(t *testing.T) {
banktypes.NewMsgSend(
testAddresses[0],
testAddresses[1],
sdk.NewCoins(sdk.NewInt64Coin("uMage", 100e6)),
sdk.NewCoins(sdk.NewInt64Coin("umage", 100e6)),
),
},
checkTx: false,
Expand Down Expand Up @@ -127,7 +127,7 @@ func TestAuthzLimiterDecorator(t *testing.T) {
[]sdk.Msg{banktypes.NewMsgSend(
testAddresses[0],
testAddresses[3],
sdk.NewCoins(sdk.NewInt64Coin("uMage", 100e6)),
sdk.NewCoins(sdk.NewInt64Coin("umage", 100e6)),
)}),
},
checkTx: false,
Expand Down Expand Up @@ -160,7 +160,7 @@ func TestAuthzLimiterDecorator(t *testing.T) {
banktypes.NewMsgSend(
testAddresses[0],
testAddresses[3],
sdk.NewCoins(sdk.NewInt64Coin("uMage", 100e6)),
sdk.NewCoins(sdk.NewInt64Coin("umage", 100e6)),
),
&evmtypes.MsgEthereumTx{},
},
Expand Down
16 changes: 8 additions & 8 deletions app/ante/eip712_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,10 @@ func (suite *EIP712TestSuite) SetupTest() {
pricefeedtypes.ModuleName: cdc.MustMarshalJSON(&pricefeedGenState),
}

// funds our test accounts with some uMage
// funds our test accounts with some umage
coinsGenState := app.NewFundedGenStateWithSameCoins(
tApp.AppCodec(),
sdk.NewCoins(sdk.NewInt64Coin("uMage", 1e9)),
sdk.NewCoins(sdk.NewInt64Coin("umage", 1e9)),
[]sdk.AccAddress{suite.testAddr, suite.testAddr2},
)

Expand Down Expand Up @@ -449,7 +449,7 @@ func (suite *EIP712TestSuite) deployUSDCERC20(app app.TestApp, ctx sdk.Context)
suite.tApp.FundModuleAccount(
suite.ctx,
evmutiltypes.ModuleName,
sdk.NewCoins(sdk.NewCoin("uMage", sdk.NewInt(0))),
sdk.NewCoins(sdk.NewCoin("umage", sdk.NewInt(0))),
)

contractAddr, err := suite.evmutilKeeper.DeployTestMintableERC20Contract(suite.ctx, "USDC", "USDC", uint8(18))
Expand Down Expand Up @@ -546,7 +546,7 @@ func (suite *EIP712TestSuite) TestEIP712Tx() {
errMsg: "insufficient funds",
updateTx: func(txBuilder client.TxBuilder, msgs []sdk.Msg) client.TxBuilder {
bk := suite.tApp.GetBankKeeper()
gasCoins := bk.GetBalance(suite.ctx, suite.testAddr, "uMage")
gasCoins := bk.GetBalance(suite.ctx, suite.testAddr, "umage")
suite.tApp.GetBankKeeper().SendCoins(suite.ctx, suite.testAddr, suite.testAddr2, sdk.NewCoins(gasCoins))
return txBuilder
},
Expand All @@ -558,7 +558,7 @@ func (suite *EIP712TestSuite) TestEIP712Tx() {
failCheckTx: true,
errMsg: "invalid chain-id",
updateTx: func(txBuilder client.TxBuilder, msgs []sdk.Msg) client.TxBuilder {
gasAmt := sdk.NewCoins(sdk.NewCoin("uMage", sdk.NewInt(20)))
gasAmt := sdk.NewCoins(sdk.NewCoin("umage", sdk.NewInt(20)))
return suite.createTestEIP712CosmosTxBuilder(
suite.testAddr, suite.testPrivKey, "Magetest_12-1", uint64(helpers.DefaultGenTxGas*10), gasAmt, msgs,
)
Expand All @@ -571,7 +571,7 @@ func (suite *EIP712TestSuite) TestEIP712Tx() {
failCheckTx: true,
errMsg: "invalid pubkey",
updateTx: func(txBuilder client.TxBuilder, msgs []sdk.Msg) client.TxBuilder {
gasAmt := sdk.NewCoins(sdk.NewCoin("uMage", sdk.NewInt(20)))
gasAmt := sdk.NewCoins(sdk.NewCoin("umage", sdk.NewInt(20)))
return suite.createTestEIP712CosmosTxBuilder(
suite.testAddr2, suite.testPrivKey2, ChainID, uint64(helpers.DefaultGenTxGas*10), gasAmt, msgs,
)
Expand Down Expand Up @@ -611,7 +611,7 @@ func (suite *EIP712TestSuite) TestEIP712Tx() {
msgs = tc.updateMsgs(msgs)
}

gasAmt := sdk.NewCoins(sdk.NewCoin("uMage", sdk.NewInt(20)))
gasAmt := sdk.NewCoins(sdk.NewCoin("umage", sdk.NewInt(20)))
txBuilder := suite.createTestEIP712CosmosTxBuilder(
suite.testAddr, suite.testPrivKey, ChainID, uint64(helpers.DefaultGenTxGas*10), gasAmt, msgs,
)
Expand Down Expand Up @@ -697,7 +697,7 @@ func (suite *EIP712TestSuite) TestEIP712Tx_DepositAndWithdraw() {
}

// deliver deposit msg
gasAmt := sdk.NewCoins(sdk.NewCoin("uMage", sdk.NewInt(20)))
gasAmt := sdk.NewCoins(sdk.NewCoin("umage", sdk.NewInt(20)))
txBuilder := suite.createTestEIP712CosmosTxBuilder(
suite.testAddr, suite.testPrivKey, ChainID, uint64(helpers.DefaultGenTxGas*10), gasAmt, depositMsgs,
)
Expand Down
30 changes: 15 additions & 15 deletions app/ante/min_gas_filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,29 +44,29 @@ func TestEvmMinGasFilter(t *testing.T) {
mustParseDecCoins(""),
},
{
"zero uMage gas price",
mustParseDecCoins("0uMage"),
mustParseDecCoins("0uMage"),
"zero umage gas price",
mustParseDecCoins("0umage"),
mustParseDecCoins("0umage"),
},
{
"non-zero uMage gas price",
mustParseDecCoins("0.001uMage"),
mustParseDecCoins("0.001uMage"),
"non-zero umage gas price",
mustParseDecCoins("0.001umage"),
mustParseDecCoins("0.001umage"),
},
{
"zero uMage gas price, min aMage price",
mustParseDecCoins("0uMage;100000aMage"),
mustParseDecCoins("0uMage"), // aMage is removed
"zero umage gas price, min aMage price",
mustParseDecCoins("0umage;100000aMage"),
mustParseDecCoins("0umage"), // aMage is removed
},
{
"zero uMage gas price, min aMage price, other token",
mustParseDecCoins("0uMage;100000aMage;0.001other"),
mustParseDecCoins("0uMage;0.001other"), // aMage is removed
"zero umage gas price, min aMage price, other token",
mustParseDecCoins("0umage;100000aMage;0.001other"),
mustParseDecCoins("0umage;0.001other"), // aMage is removed
},
{
"non-zero uMage gas price, min aMage price",
mustParseDecCoins("0.25uMage;100000aMage;0.001other"),
mustParseDecCoins("0.25uMage;0.001other"), // aMage is removed
"non-zero umage gas price, min aMage price",
mustParseDecCoins("0.25umage;100000aMage;0.001other"),
mustParseDecCoins("0.25umage;0.001other"), // aMage is removed
},
}

Expand Down
2 changes: 1 addition & 1 deletion app/ante/vesting_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func TestVestingMempoolDecorator_MsgCreateVestingAccount_Unauthorized(t *testing
[]sdk.Msg{
vesting.NewMsgCreateVestingAccount(
testAddresses[0], testAddresses[1],
sdk.NewCoins(sdk.NewInt64Coin("uMage", 100_000_000)),
sdk.NewCoins(sdk.NewInt64Coin("umage", 100_000_000)),
time.Date(1998, 1, 1, 0, 0, 0, 0, time.UTC).Unix(), false),
},
sdk.NewCoins(),
Expand Down
4 changes: 2 additions & 2 deletions app/legacy_tx_broadcast_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ func (suite *LegacyTxBroadcastTestSuite) TestSimulateRequest() {
suite.Require().NoError(err)

// build a legacy transaction
msgs := []sdk.Msg{banktypes.NewMsgSend(fromAddr, toAddr, sdk.NewCoins(sdk.NewCoin("uMage", sdk.NewInt(1e6))))}
fee := legacytx.NewStdFee(1e6, sdk.NewCoins(sdk.NewCoin("uMage", sdk.NewInt(5e4))))
msgs := []sdk.Msg{banktypes.NewMsgSend(fromAddr, toAddr, sdk.NewCoins(sdk.NewCoin("umage", sdk.NewInt(1e6))))}
fee := legacytx.NewStdFee(1e6, sdk.NewCoins(sdk.NewCoin("umage", sdk.NewInt(5e4))))
sigs := []legacytx.StdSignature{legacytx.NewStdSignature(pk, []byte("an amino json signed signature"))}
stdTx := legacytx.NewStdTx(msgs, fee, sigs, "legacy broadcast test")
stdTx.TimeoutHeight = 100000
Expand Down
2 changes: 1 addition & 1 deletion app/query/distribution/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (suite queryTestSuite) CheckCommunityPoolBalance(expected sdk.Coins, result
}

func (suite *queryTestSuite) Test_CommunityPoolOverride() {
singleDenom := sdk.NewCoins(sdk.NewInt64Coin("uMage", 1e10))
singleDenom := sdk.NewCoins(sdk.NewInt64Coin("umage", 1e10))
multiDenom := singleDenom.Add(sdk.NewInt64Coin("other-denom", 1e9))

testCases := []struct {
Expand Down
2 changes: 1 addition & 1 deletion app/tally_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func (th TallyHandler) Tally(ctx sdk.Context, proposal types.Proposal) (passes b
currValidators[valAddrStr] = val
}

// votingPower = amount of uMage coin
// votingPower = amount of umage coin
stakedCoins, err := th.lk.GetStakedTokensForDerivatives(ctx, sdk.NewCoins(coin))
if err != nil {
// error is returned only if the bMage denom is incorrect, which should never happen here.
Expand Down
2 changes: 1 addition & 1 deletion app/tally_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (suite *tallyHandlerSuite) SetupTest() {
suite.ctx = suite.app.NewContext(false, tmproto.Header{Height: 1, Time: genesisTime})

suite.staking = stakingHelper{suite.app.GetStakingKeeper()}
suite.staking.setBondDenom(suite.ctx, "uMage")
suite.staking.setBondDenom(suite.ctx, "umage")

suite.tallier = NewTallyHandler(
suite.app.GetGovKeeper(),
Expand Down
Loading

0 comments on commit f46e847

Please sign in to comment.