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: prepare v7.0.0 #405

Merged
merged 4 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
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

This file was deleted.

1 change: 1 addition & 0 deletions .changelog/v7.0.0/bug-fixes/405-bump-halo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Update `x/halo` to correctly check recipient role when trading to fiat. ([#405](https://github.com/noble-assets/noble/pull/405))
11 changes: 11 additions & 0 deletions .changelog/v7.0.0/summary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
*Sep 13, 2024*

This is the Numus major release of Noble. It introduces a new `x/florin` module
that enables the native issuance of [Monerium's EUR emoney (**EURe**)][eure]
asset. EURe is issued by Monerium EMI, a regulated entity, licensed in the EEA.
E-money is recognized as a digital alternative to cash, 1:1 backed in
high-quality liquid assets and is unconditionally redeemable on demand.

Other notable changes are documented below.

[eure]: https://monerium.com
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# CHANGELOG

## v7.0.0

*Sep 13, 2024*

This is the Numus major release of Noble. It introduces a new `x/florin` module
that enables the native issuance of [Monerium's EUR emoney (**EURe**)][eure]
asset. EURe is issued by Monerium EMI, a regulated entity, licensed in the EEA.
E-money is recognized as a digital alternative to cash, 1:1 backed in
high-quality liquid assets and is unconditionally redeemable on demand.

Other notable changes are documented below.

[eure]: https://monerium.com

### BUG FIXES

- Update `x/halo` to correctly check recipient role when trading to fiat. ([#405](https://github.com/noble-assets/noble/pull/405))

### IMPROVEMENTS

- Update module path for v7 release line. ([#399](https://github.com/noble-assets/noble/pull/399))

## v6.0.0

*Aug 27, 2024*
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ endif
### Protobuf ###
###############################################################################

BUF_VERSION=1.39
BUF_VERSION=1.40

proto-all: proto-format proto-lint proto-gen

Expand Down
10 changes: 1 addition & 9 deletions app/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,21 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
ibcante "github.com/cosmos/ibc-go/v4/modules/core/ante"
ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper"
"github.com/noble-assets/forwarding/x/forwarding"
forwardingkeeper "github.com/noble-assets/forwarding/x/forwarding/keeper"
forwardingtypes "github.com/noble-assets/forwarding/x/forwarding/types"
feeante "github.com/noble-assets/noble/v7/x/globalfee/ante"
)

type BankKeeper interface {
authtypes.BankKeeper
forwardingtypes.BankKeeper
}

type HandlerOptions struct {
ante.HandlerOptions
cdc codec.Codec
fiatTokenFactoryKeeper *fiattokenfactorykeeper.Keeper
IBCKeeper *ibckeeper.Keeper
GlobalFeeSubspace paramtypes.Subspace
StakingSubspace paramtypes.Subspace
BankKeeper BankKeeper
ForwardingKeeper *forwardingkeeper.Keeper
}

Expand Down Expand Up @@ -75,7 +67,7 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
ante.NewSetPubKeyDecorator(options.AccountKeeper), // SetPubKeyDecorator must be called before all signature verification decorators
ante.NewValidateSigCountDecorator(options.AccountKeeper),
ante.NewSigGasConsumeDecorator(options.AccountKeeper, sigGasConsumer),
forwarding.NewSigVerificationDecorator(options.AccountKeeper, options.BankKeeper, options.SignModeHandler),
ante.NewSigVerificationDecorator(options.AccountKeeper, options.SignModeHandler),
ante.NewIncrementSequenceDecorator(options.AccountKeeper),
ibcante.NewAnteDecorator(options.IBCKeeper),
}
Expand Down
10 changes: 5 additions & 5 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ import (
halokeeper "github.com/noble-assets/halo/x/halo/keeper"
halotypes "github.com/noble-assets/halo/x/halo/types"

"github.com/noble-assets/florin/x/florin"
florinkeeper "github.com/noble-assets/florin/x/florin/keeper"
florintypes "github.com/noble-assets/florin/x/florin/types"
"github.com/monerium/module-noble/x/florin"
florinkeeper "github.com/monerium/module-noble/x/florin/keeper"
florintypes "github.com/monerium/module-noble/x/florin/types"
)

const (
Expand Down Expand Up @@ -740,9 +740,10 @@ func New(
HandlerOptions{
HandlerOptions: ante.HandlerOptions{
AccountKeeper: app.AccountKeeper,
BankKeeper: app.BankKeeper,
FeegrantKeeper: app.FeeGrantKeeper,
SignModeHandler: encodingConfig.TxConfig.SignModeHandler(),
SigGasConsumer: forwarding.SigVerificationGasConsumer,
SigGasConsumer: ante.DefaultSigVerificationGasConsumer,
},
cdc: appCodec,
fiatTokenFactoryKeeper: app.FiatTokenFactoryKeeper,
Expand All @@ -751,7 +752,6 @@ func New(
GlobalFeeSubspace: app.GetSubspace(globalfee.ModuleName),
StakingSubspace: app.GetSubspace(stakingtypes.ModuleName),

BankKeeper: app.BankKeeper,
ForwardingKeeper: app.ForwardingKeeper,
},
)
Expand Down
2 changes: 1 addition & 1 deletion app/upgrades/numus/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"github.com/cosmos/cosmos-sdk/baseapp"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
florintypes "github.com/noble-assets/florin/x/florin/types"
florintypes "github.com/monerium/module-noble/x/florin/types"
)

func CreateStoreLoader(upgradeHeight int64) baseapp.StoreLoader {
Expand Down
7 changes: 4 additions & 3 deletions app/upgrades/numus/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ package numus

import (
"fmt"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
florinkeeper "github.com/noble-assets/florin/x/florin/keeper"
florinkeeper "github.com/monerium/module-noble/x/florin/keeper"
paramskeeper "github.com/strangelove-ventures/paramauthority/x/params/keeper"
)

Expand All @@ -32,8 +33,8 @@ func CreateUpgradeHandler(
florinKeeper.SetOwner(ctx, "ueure", "noble1tv9u97jln0k3anpzhahkeahh66u74dug302pyn")
florinKeeper.SetBlacklistOwner(ctx, "noble1tv9u97jln0k3anpzhahkeahh66u74dug302pyn")
case MainnetChainID:
florinKeeper.SetOwner(ctx, "ueure", "") // TODO
florinKeeper.SetBlacklistOwner(ctx, "") // TODO
florinKeeper.SetOwner(ctx, "ueure", "noble1ya7ggnwv78qcnkv89lte30yge54ztzst3usgmw")
florinKeeper.SetBlacklistOwner(ctx, "noble1ya7ggnwv78qcnkv89lte30yge54ztzst3usgmw")
default:
return vm, fmt.Errorf("%s upgrade not allowed to execute on %s chain", UpgradeName, ctx.ChainID())
}
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ require (
github.com/golang/protobuf v1.5.3
github.com/gorilla/mux v1.8.0
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/noble-assets/florin v1.0.0-rc.1
github.com/noble-assets/forwarding v1.2.0-rc.0
github.com/noble-assets/halo v1.0.0
github.com/monerium/module-noble v1.0.0
github.com/noble-assets/forwarding v1.1.0
github.com/noble-assets/halo v1.0.1
github.com/ondoprotocol/usdy-noble v1.0.0
github.com/rs/zerolog v1.27.0
github.com/spf13/cast v1.5.1
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,8 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8=
github.com/monerium/module-noble v1.0.0 h1:MSdGacwXDMeV11MedvIjtfAKJ4QLOTKWpCRJBs+uvjI=
github.com/monerium/module-noble v1.0.0/go.mod h1:eg2ur9ZGvnASANV5iNvyGT2JPbg/499+UZOCB843j1c=
github.com/moricho/tparallel v0.3.1 h1:fQKD4U1wRMAYNngDonW5XupoB/ZGJHdpzrWqgyg9krA=
github.com/moricho/tparallel v0.3.1/go.mod h1:leENX2cUv7Sv2qDgdi0D0fCftN8fRC67Bcn8pqzeYNI=
github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ=
Expand Down Expand Up @@ -965,12 +967,10 @@ github.com/nishanths/predeclared v0.2.2 h1:V2EPdZPliZymNAn79T8RkNApBjMmVKh5XRpLm
github.com/nishanths/predeclared v0.2.2/go.mod h1:RROzoN6TnGQupbC+lqggsOlcgysk3LMK/HI84Mp280c=
github.com/noble-assets/cosmos-sdk v0.45.16-send-restrictions h1:oQwbCoejkXp2/ozQSwc//A6UW9wJl71YgP7o04MsYq0=
github.com/noble-assets/cosmos-sdk v0.45.16-send-restrictions/go.mod h1:bScuNwWAP0TZJpUf+SHXRU3xGoUPp+X9nAzfeIXts40=
github.com/noble-assets/florin v1.0.0-rc.1 h1:0O8Xr0Jqos7lvyvdtQE8Y0WcNH5PvfIJsocPeYLufh8=
github.com/noble-assets/florin v1.0.0-rc.1/go.mod h1:W+6DjaZdSRQe2oqv8eCHQtbyp36LUNImGRCLdPNSA2o=
github.com/noble-assets/forwarding v1.2.0-rc.0 h1:f/bL/cicvhNUp9SuueiqqqSVRRn7CQxTKOesVUKrSyQ=
github.com/noble-assets/forwarding v1.2.0-rc.0/go.mod h1:o64ZfzCHteRDhOlkpi7GeKAcjlcbWUihC7Y34Er2/3U=
github.com/noble-assets/halo v1.0.0 h1:JG5TAZZcuLArYgl/9dgwJJ9KAOIo2f03/S010WRVNV8=
github.com/noble-assets/halo v1.0.0/go.mod h1:AUFdixNgPdce0soYfT6aNggwW9PUVFxaIkCC83M26Sk=
github.com/noble-assets/forwarding v1.1.0 h1:2TXBs2Y9vWqgHyDKtdcHht6i7OT+pLaVHE3bPvfpmJY=
github.com/noble-assets/forwarding v1.1.0/go.mod h1:o64ZfzCHteRDhOlkpi7GeKAcjlcbWUihC7Y34Er2/3U=
github.com/noble-assets/halo v1.0.1 h1:Fndy4JaAAvEd5SDGECnkoWJ2uVG1XCF47L67Px9ickE=
github.com/noble-assets/halo v1.0.1/go.mod h1:AUFdixNgPdce0soYfT6aNggwW9PUVFxaIkCC83M26Sk=
github.com/nunnatsa/ginkgolinter v0.14.0 h1:XQPNmw+kZz5cC/HbFK3mQutpjzAQv1dHregRA+4CGGg=
github.com/nunnatsa/ginkgolinter v0.14.0/go.mod h1:cm2xaqCUCRd7qcP4DqbVvpcyEMkuLM9CF0wY6VASohk=
github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78=
Expand Down
28 changes: 0 additions & 28 deletions interchaintest/forwarding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,34 +65,6 @@ func TestForwarding_RegisterOnNoble(t *testing.T) {
require.Equal(t, sdk.NewCoins(sdk.NewCoin("uusdc", sdk.NewInt(1_000_000))), stats.TotalForwarded)
}

func TestForwarding_RegisterSignerlessly(t *testing.T) {
t.Parallel()

ctx, wrapper, _, _, _, sender, receiver := ForwardingSuite(t)
validator := wrapper.chain.Validators[0]

address, exists := ForwardingAccount(t, ctx, validator, receiver)
require.False(t, exists)

require.NoError(t, validator.SendFunds(ctx, sender.KeyName(), ibc.WalletAmount{
Address: address,
Denom: "uusdc",
Amount: 1_000_000,
}))

_, exists = ForwardingAccount(t, ctx, validator, receiver)
require.False(t, exists)

// NOTE: The keyName argument is intentionally left blank here. If
// everything is working correctly, this shouldn't error as we don't need
// to interact with the keyring.
_, err := validator.ExecTx(ctx, "", "forwarding", "register-account-signerlessly", "channel-0", receiver.FormattedAddress())
require.NoError(t, err)

_, exists = ForwardingAccount(t, ctx, validator, receiver)
require.True(t, exists)
}

func TestForwarding_RegisterViaTransfer(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 1 addition & 1 deletion interchaintest/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/ethereum/go-ethereum v1.12.2
github.com/gogo/protobuf v1.3.3
github.com/icza/dyno v0.0.0-20220812133438-f0b6f8a18845
github.com/noble-assets/forwarding v1.2.0-rc.0
github.com/noble-assets/forwarding v1.1.0
github.com/noble-assets/noble/v7 v7.0.0
github.com/strangelove-ventures/interchaintest/v4 v4.0.0-20231026153934-334934f17a68
github.com/strangelove-ventures/paramauthority v1.1.0
Expand Down
4 changes: 2 additions & 2 deletions interchaintest/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -808,8 +808,8 @@ github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxzi
github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c=
github.com/neilotoole/errgroup v0.1.6/go.mod h1:Q2nLGf+594h0CLBs/Mbg6qOr7GtqDK7C2S41udRnToE=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/noble-assets/forwarding v1.2.0-rc.0 h1:f/bL/cicvhNUp9SuueiqqqSVRRn7CQxTKOesVUKrSyQ=
github.com/noble-assets/forwarding v1.2.0-rc.0/go.mod h1:o64ZfzCHteRDhOlkpi7GeKAcjlcbWUihC7Y34Er2/3U=
github.com/noble-assets/forwarding v1.1.0 h1:2TXBs2Y9vWqgHyDKtdcHht6i7OT+pLaVHE3bPvfpmJY=
github.com/noble-assets/forwarding v1.1.0/go.mod h1:o64ZfzCHteRDhOlkpi7GeKAcjlcbWUihC7Y34Er2/3U=
github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs=
Expand Down
2 changes: 1 addition & 1 deletion interchaintest/upgrade_grand-1_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func TestGrand1ChainUpgrade(t *testing.T) {
{
// numus is a major release that introduced the florin module.
upgradeName: "numus",
image: nobleImageInfo[0],
image: ghcrImage("v7.0.0-rc.0"),
},
}

Expand Down
2 changes: 1 addition & 1 deletion x/globalfee/ante/fee.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (mfd FeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, ne
// i.e., totalGas <= MaxTotalBypassMinFeeMsgGasUsage
// Otherwise, minimum fees and global fees are checked to prevent spam.
doesNotExceedMaxGasUsage := gas <= mfd.MaxTotalBypassMinFeeMsgGasUsage
allowedToBypassMinFee := (mfd.containsOnlyBypassMinFeeMsgs(ctx, msgs) || mfd.isSignerlessForwardingRegistration(msgs)) && doesNotExceedMaxGasUsage
allowedToBypassMinFee := mfd.containsOnlyBypassMinFeeMsgs(ctx, msgs) && doesNotExceedMaxGasUsage

var allFees sdk.Coins
requiredGlobalFees, err := mfd.getGlobalFee(ctx, feeTx)
Expand Down
16 changes: 0 additions & 16 deletions x/globalfee/ante/fee_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"math"

sdk "github.com/cosmos/cosmos-sdk/types"
forwardingtypes "github.com/noble-assets/forwarding/x/forwarding/types"
globalfeetypes "github.com/noble-assets/noble/v7/x/globalfee/types"
tmstrings "github.com/tendermint/tendermint/libs/strings"
)
Expand Down Expand Up @@ -46,21 +45,6 @@ func (mfd FeeDecorator) containsOnlyBypassMinFeeMsgs(ctx sdk.Context, msgs []sdk
return true
}

func (mfd FeeDecorator) isSignerlessForwardingRegistration(msgs []sdk.Msg) bool {
if len(msgs) != 1 {
return false
}

msg, ok := msgs[0].(*forwardingtypes.MsgRegisterAccount)
if !ok {
return false
}

address := forwardingtypes.GenerateAddress(msg.Channel, msg.Recipient)

return msg.Signer == address.String()
}

// DenomsSubsetOfIncludingZero and IsAnyGTEIncludingZero are similar to DenomsSubsetOf and IsAnyGTE in sdk. Since we allow zero coins in global fee(zero coins means the chain does not want to set a global fee but still want to define the fee's denom)
//
// overwrite DenomsSubsetOfIncludingZero from sdk, to allow zero amt coins in superset. e.g. 1stake is DenomsSubsetOfIncludingZero 0stake. [] is the DenomsSubsetOfIncludingZero of [0stake] but not [1stake].
Expand Down