Skip to content
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
### Breaking Changes

* (mempool) [#25338](https://github.com/cosmos/cosmos-sdk/pull/25338) Respect gas wanted returned by the ante handler for block selection. Adds `InsertWithOption` to the `Mempool` interface (carries the ante-reported `GasWanted`) and changes the `SelectBy` callback to receive a `mempool.Tx` wrapper that exposes the stored value.
* (tx) [#26456](https://github.com/cosmos/cosmos-sdk/pull/26456) Remove `SIGN_MODE_TEXTUAL` and all associated implementation (`x/tx/signing/textual`, `x/auth/tx/textual.go`, `TextualCoinMetadataQueryFn`). The proto enum value is reserved to prevent future reuse. ADR-050 is marked archived.
* (modules) [#26421](https://github.com/cosmos/cosmos-sdk/pull/26421) Remove the `x/protocolpool` module and its API/proto surface from the SDK. Applications upgrading from v0.54 should include `protocolpool` in deleted store upgrades.
* (genutils) [#26468](https://github.com/cosmos/cosmos-sdk/pull/26468) Consolidate ExportGenesisFileWithTime arguments to preserve consensus params.

Expand Down
32 changes: 32 additions & 0 deletions UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,43 @@ For a full list of changes, see the [Changelog](https://github.com/cosmos/cosmos

## Table of Contents

* [Breaking Changes](#breaking-changes)
* [Removed: SIGN_MODE_TEXTUAL](#removed-sign_mode_textual)
* [New Features and Non-Breaking Changes](#new-features-and-non-breaking-changes)
* [ML-DSA-65 Validator Keys](#ml-dsa-65-validator-consensus-keys)



## Breaking Changes

### Removed: SIGN_MODE_TEXTUAL

`SIGN_MODE_TEXTUAL` (proto enum value `2`) and its entire implementation have been removed:

- `x/tx/signing/textual/` — all renderers, the CBOR encoder, test data, and internal protos
- `x/auth/tx/textual.go` and `ConfigOptions.TextualCoinMetadataQueryFn`
- Ledger + SIGN_MODE_TEXTUAL integration in `client/` flags and tx factory

The proto enum value `2` and string `"SIGN_MODE_TEXTUAL"` are **reserved** to prevent future reuse. ADR-050 is archived.

**Required action** if your app enabled SIGN_MODE_TEXTUAL:

1. Remove `TextualCoinMetadataQueryFn` from your `tx.ConfigOptions`:

```go
// Before
txConfig, err := tx.NewTxConfigWithOptions(cdc, tx.ConfigOptions{
TextualCoinMetadataQueryFn: ...,
})

// After — field removed, omit it
txConfig, err := tx.NewTxConfigWithOptions(cdc, tx.ConfigOptions{...})
```

2. Remove any `SIGN_MODE_TEXTUAL` cases from signing mode handler switch statements.

3. Remove Ledger wiring that depended on `SIGN_MODE_TEXTUAL`.

## New Features and Non-Breaking Changes

These changes are informational and optional to adopt during the upgrade; they are not required for a successful migration.
Expand Down
117 changes: 0 additions & 117 deletions api/cosmos/msg/textual/v1/textual.pulsar.go

This file was deleted.

8 changes: 0 additions & 8 deletions api/cosmos/tx/signing/v1beta1/signing.pulsar.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 0 additions & 10 deletions client/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"crypto/tls"
"fmt"
"slices"
"strings"

"github.com/cockroachdb/errors"
Expand All @@ -15,8 +14,6 @@ import (
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/credentials/insecure"

signingv1beta1 "cosmossdk.io/api/cosmos/tx/signing/v1beta1"

"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/crypto/keyring"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down Expand Up @@ -286,18 +283,11 @@ func readTxCommandFlags(clientCtx Context, flagSet *pflag.FlagSet) (Context, err

clientCtx = clientCtx.WithFrom(from).WithFromAddress(fromAddr).WithFromName(fromName)

if keyType == keyring.TypeLedger && clientCtx.SignModeStr == flags.SignModeTextual {
if !slices.Contains(clientCtx.TxConfig.SignModeHandler().SupportedModes(), signingv1beta1.SignMode_SIGN_MODE_TEXTUAL) {
return clientCtx, fmt.Errorf("SIGN_MODE_TEXTUAL is not available")
}
}

// If the `from` signer account is a ledger key, we need to use
// SIGN_MODE_AMINO_JSON, because ledger doesn't support proto yet.
// ref: https://github.com/cosmos/cosmos-sdk/issues/8109
if keyType == keyring.TypeLedger &&
clientCtx.SignModeStr != flags.SignModeLegacyAminoJSON &&
clientCtx.SignModeStr != flags.SignModeTextual &&
!clientCtx.LedgerHasProtobuf {
fmt.Println("Default sign-mode 'direct' not supported by Ledger, using sign-mode 'amino-json'.")
clientCtx = clientCtx.WithSignModeStr(flags.SignModeLegacyAminoJSON)
Expand Down
4 changes: 1 addition & 3 deletions client/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ const (
SignModeLegacyAminoJSON = "amino-json"
// SignModeDirectAux is the value of the --sign-mode flag for SIGN_MODE_DIRECT_AUX
SignModeDirectAux = "direct-aux"
// SignModeTextual is the value of the --sign-mode flag for SIGN_MODE_TEXTUAL.
SignModeTextual = "textual"
// SignModeEIP191 is the value of the --sign-mode flag for SIGN_MODE_EIP_191
SignModeEIP191 = "eip-191"
)
Expand Down Expand Up @@ -136,7 +134,7 @@ func AddTxFlagsToCmd(cmd *cobra.Command) {
f.Bool(FlagGenerateOnly, false, "Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name)")
f.Bool(FlagOffline, false, "Offline mode (does not allow any online functionality)")
f.BoolP(FlagSkipConfirmation, "y", false, "Skip tx broadcasting prompt confirmation")
f.String(FlagSignMode, "", "Choose sign mode (direct|amino-json|direct-aux|textual), this is an advanced feature")
f.String(FlagSignMode, "", "Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature")
f.Uint64(FlagTimeoutHeight, 0, "DEPRECATED: Please use --timeout-duration instead. Set a block timeout height to prevent the tx from being committed past a certain height")
f.Duration(TimeoutDuration, 0, "TimeoutDuration is the duration the transaction will be considered valid in the mempool. The transaction's unordered nonce will be set to the time of transaction creation + the duration value passed. If the transaction is still in the mempool, and the block time has passed the time of submission + TimeoutDuration, the transaction will be rejected.")
f.Bool(FlagUnordered, false, "Enable unordered transaction delivery; must be used in conjunction with --timeout-duration")
Expand Down
2 changes: 0 additions & 2 deletions client/tx/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ func NewFactoryCLI(clientCtx client.Context, flagSet *pflag.FlagSet) (Factory, e
signMode = signing.SignMode_SIGN_MODE_LEGACY_AMINO_JSON
case flags.SignModeDirectAux:
signMode = signing.SignMode_SIGN_MODE_DIRECT_AUX
case flags.SignModeTextual:
signMode = signing.SignMode_SIGN_MODE_TEXTUAL
case flags.SignModeEIP191:
signMode = signing.SignMode_SIGN_MODE_EIP_191
}
Expand Down
4 changes: 2 additions & 2 deletions core/coins/format_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type coinsJSONTest struct {

func TestFormatCoin(t *testing.T) {
var testcases []coinJSONTest
raw, err := os.ReadFile("../../x/tx/signing/textual/internal/testdata/coin.json")
raw, err := os.ReadFile("internal/testdata/coin.json")
require.NoError(t, err)
Comment thread
aljo242 marked this conversation as resolved.
err = json.Unmarshal(raw, &testcases)
require.NoError(t, err)
Expand All @@ -54,7 +54,7 @@ func TestFormatCoin(t *testing.T) {

func TestFormatCoins(t *testing.T) {
var testcases []coinsJSONTest
raw, err := os.ReadFile("../../x/tx/signing/textual/internal/testdata/coins.json")
raw, err := os.ReadFile("internal/testdata/coins.json")
require.NoError(t, err)
err = json.Unmarshal(raw, &testcases)
require.NoError(t, err)
Expand Down
5 changes: 0 additions & 5 deletions crypto/keyring/keyring.go
Original file line number Diff line number Diff line change
Expand Up @@ -655,11 +655,6 @@ func SignWithLedger(k *Record, msg []byte, signMode signing.SignMode) (sig []byt
}

switch signMode {
case signing.SignMode_SIGN_MODE_TEXTUAL:
sig, err = priv.Sign(msg)
if err != nil {
return nil, nil, err
}
case signing.SignMode_SIGN_MODE_LEGACY_AMINO_JSON:
sig, err = priv.SignLedgerAminoJSON(msg)
if err != nil {
Expand Down
3 changes: 1 addition & 2 deletions crypto/ledger/ledger_secp256k1.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,7 @@ func (pkl PrivKeyLedgerSecp256k1) PubKey() types.PubKey {
return pkl.CachedPubKey
}

// Sign returns a secp256k1 signature for the corresponding message using
// SIGN_MODE_TEXTUAL.
// Sign returns a secp256k1 signature for the corresponding message.
func (pkl PrivKeyLedgerSecp256k1) Sign(message []byte) ([]byte, error) {
device, err := getDevice()
if err != nil {
Expand Down
2 changes: 2 additions & 0 deletions docs/architecture/adr-050-sign-mode-textual-annex1.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# ADR 050: SIGN_MODE_TEXTUAL: Annex 1 Value Renderers

## Status: ARCHIVED

## Changelog

* Dec 06, 2021: Initial Draft
Expand Down
2 changes: 2 additions & 0 deletions docs/architecture/adr-050-sign-mode-textual-annex2.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# ADR 050: SIGN_MODE_TEXTUAL: Annex 2 XXX

## Status: ARCHIVED

## Changelog

* Oct 3, 2022: Initial Draft
Expand Down
2 changes: 2 additions & 0 deletions docs/architecture/adr-050-sign-mode-textual.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# ADR 050: SIGN_MODE_TEXTUAL

## Status: ARCHIVED

## Changelog

* Dec 06, 2021: Initial Draft.
Expand Down
10 changes: 0 additions & 10 deletions docs/docs/learn/advanced/01-transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,6 @@ The use case is a multi-signer transaction, where one of the signers is appointe
create the final transaction by appending a fee. Note that the fee payer of the transaction (in our case Charlie) must sign over the fees, so must use `SIGN_MODE_DIRECT` or `SIGN_MODE_LEGACY_AMINO_JSON`.


#### `SIGN_MODE_TEXTUAL`

`SIGN_MODE_TEXTUAL` is a new sign mode for delivering a better signing experience on hardware wallets and it is included in the v0.50 release. In this mode, the signer signs over the human-readable string representation of the transaction (CBOR) and makes all data being displayed easier to read. The data is formatted as screens, and each screen is meant to be displayed in its entirety even on small devices like the Ledger Nano.

There are also _expert_ screens, which will only be displayed if the user has chosen that option in its hardware device. These screens contain things like account number, account sequence and the sign data hash.

Data is formatted using a set of `ValueRenderer` which the SDK provides defaults for all the known messages and value types. Chain developers can also opt to implement their own `ValueRenderer` for a type/message if they'd like to display information differently.

If you wish to learn more, please refer to [ADR-050](../../build/architecture/adr-050-sign-mode-textual.md).

#### Custom Sign modes

There is an opportunity to add your own custom sign mode to the Cosmos-SDK. While we cannot accept the implementation of the sign mode to the repository, we can accept a pull request to add the custom signmode to the SignMode enum located [here](https://github.com/cosmos/cosmos-sdk/blob/v0.53.0/proto/cosmos/tx/signing/v1beta1/signing.proto#L17)
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/learn/beginner/03-accounts.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ The default implementation of `Keyring` comes from the third-party [`99designs/k

A few notes on the `Keyring` methods:

* `Sign(uid string, msg []byte, signMode signing.SignMode) ([]byte, types.PubKey, error)` strictly deals with the signature of the `msg` bytes. You must prepare and encode the transaction into a canonical `[]byte` form. Because protobuf is not deterministic, it has been decided in [ADR-020](../../build/architecture/adr-020-protobuf-transaction-encoding.md) that the canonical `payload` to sign is the `SignDoc` struct, deterministically encoded using [ADR-027](../../build/architecture/adr-027-deterministic-protobuf-serialization.md). The `signMode` parameter controls which signing mode is used (for example `SIGN_MODE_TEXTUAL` or `SIGN_MODE_LEGACY_AMINO_JSON`) and therefore how the `msg` bytes are produced. Note that signature verification is not implemented in the Cosmos SDK by default, it is deferred to the [`anteHandler`](../advanced/00-baseapp.md#antehandler).
* `Sign(uid string, msg []byte, signMode signing.SignMode) ([]byte, types.PubKey, error)` strictly deals with the signature of the `msg` bytes. You must prepare and encode the transaction into a canonical `[]byte` form. Because protobuf is not deterministic, it has been decided in [ADR-020](../../build/architecture/adr-020-protobuf-transaction-encoding.md) that the canonical `payload` to sign is the `SignDoc` struct, deterministically encoded using [ADR-027](../../build/architecture/adr-027-deterministic-protobuf-serialization.md). The `signMode` parameter controls which signing mode is used (for example `SIGN_MODE_DIRECT` or `SIGN_MODE_LEGACY_AMINO_JSON`) and therefore how the `msg` bytes are produced. Note that signature verification is not implemented in the Cosmos SDK by default, it is deferred to the [`anteHandler`](../advanced/00-baseapp.md#antehandler).

```protobuf reference
https://github.com/cosmos/cosmos-sdk/blob/v0.53.0/proto/cosmos/tx/v1beta1/tx.proto#L50-L67
Expand Down
9 changes: 1 addition & 8 deletions enterprise/group/simapp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ import (
storetypes "github.com/cosmos/cosmos-sdk/store/v2/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
sigtypes "github.com/cosmos/cosmos-sdk/types/tx/signing"
"github.com/cosmos/cosmos-sdk/version"
"github.com/cosmos/cosmos-sdk/x/auth"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
Expand All @@ -59,7 +58,6 @@ import (
"github.com/cosmos/cosmos-sdk/x/auth/posthandler"
authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation"
authtx "github.com/cosmos/cosmos-sdk/x/auth/tx"
txmodule "github.com/cosmos/cosmos-sdk/x/auth/tx/config"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/cosmos/cosmos-sdk/x/bank"
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
Expand Down Expand Up @@ -282,14 +280,9 @@ func NewSimApp(
groupConfig,
)

enabledSignModes := append(authtx.DefaultSignModes, sigtypes.SignMode_SIGN_MODE_TEXTUAL)
txConfigOpts := authtx.ConfigOptions{
EnabledSignModes: enabledSignModes,
TextualCoinMetadataQueryFn: txmodule.NewBankKeeperCoinMetadataQueryFn(app.BankKeeper),
}
txConfig, err := authtx.NewTxConfigWithOptions(
appCodec,
txConfigOpts,
authtx.ConfigOptions{},
)
if err != nil {
panic(err)
Expand Down
Loading
Loading