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

Favor bare binary-marshalling over length prefixed-marshalling #5799

Merged
merged 34 commits into from
Mar 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
c47055c
change abci file to use BinaryBare
jgimeno Mar 12, 2020
0ba8426
change all calls to EncodeLengthPrefixed to BinaryBare in distributio…
jgimeno Mar 12, 2020
3144b47
change all calls to EncodeLengthPrefixed to BinaryBare in mint keeper…
jgimeno Mar 12, 2020
6af1f7e
change all calls to EncodeLengthPrefixed to BinaryBare in auth keeper…
jgimeno Mar 12, 2020
12fce22
change all calls to EncodeLengthPrefixed to BinaryBare in distributio…
jgimeno Mar 12, 2020
81ecf2e
change all calls to EncodeLengthPrefixed to BinaryBare in staking kee…
jgimeno Mar 12, 2020
d967f26
change all calls to EncodeLengthPrefixed to BinaryBare in staking kee…
jgimeno Mar 12, 2020
950402e
change all calls to EncodeLengthPrefixed to BinaryBare in gov keeper …
jgimeno Mar 12, 2020
9b5f9a5
change all calls to EncodeLengthPrefixed to BinaryBare in slashing ke…
jgimeno Mar 12, 2020
3b7aecf
update decoder test
jgimeno Mar 12, 2020
30add06
migrate decoder
jgimeno Mar 12, 2020
3900e4e
migrate gov simulation decoder
jgimeno Mar 12, 2020
9907e62
Merge branch 'master' into jonathan/5748-marshal-unmashal-binare-bare
jgimeno Mar 13, 2020
f082fde
migrate baseapp_test
jgimeno Mar 13, 2020
fbefe8a
refactor QuerySubspace
jgimeno Mar 13, 2020
5d0f1e2
Merge branch 'jonathan/5748-marshal-unmashal-binare-bare' of github.c…
jgimeno Mar 13, 2020
e419105
refactor coedc std codec
jgimeno Mar 13, 2020
67cbf19
migrate keybase
jgimeno Mar 13, 2020
57ad6ac
migrate iavl store
jgimeno Mar 13, 2020
35b2ae4
migrate root multi
jgimeno Mar 13, 2020
b740903
migrate ante basic
jgimeno Mar 13, 2020
82848ef
migrate tx type to bare
jgimeno Mar 13, 2020
9ff06ed
migrate auth client
jgimeno Mar 13, 2020
f10ac70
update auth types
jgimeno Mar 13, 2020
98bd455
update decoder
jgimeno Mar 13, 2020
d235280
migrate supply decoder
jgimeno Mar 13, 2020
1f1cfac
migrate stake encoding
jgimeno Mar 13, 2020
4b3221b
migrate staking simulation
jgimeno Mar 13, 2020
e3e3605
migrate genutil
jgimeno Mar 13, 2020
3b9726f
migrate simapp test helpers
jgimeno Mar 13, 2020
8ff2f56
migrate docs
jgimeno Mar 13, 2020
78f8b3d
upgrade changelog
jgimeno Mar 13, 2020
9e845b7
Merge branch 'master' into jonathan/5748-marshal-unmashal-binare-bare
jgimeno Mar 13, 2020
ca25273
Update CHANGELOG.md
jgimeno Mar 13, 2020
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 @@ -148,6 +148,7 @@ Buffers for state serialization instead of Amino.
to define their own concrete `MsgSubmitProposal` types.
* The module now accepts a `Codec` interface which extends the `codec.Marshaler` interface by
requiring a concrete codec to know how to serialize `Proposal` types.
* (codec) [\#5799](https://github.com/cosmos/cosmos-sdk/pull/5799) Now we favor the use of MarshalBinaryBare instead of LengthPrefixed in all cases that is not needed.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* (codec) [\#5799](https://github.com/cosmos/cosmos-sdk/pull/5799) Now we favor the use of MarshalBinaryBare instead of LengthPrefixed in all cases that is not needed.
* (codec) [\#5799](https://github.com/cosmos/cosmos-sdk/pull/5799) Now we favor the use of `(Un)MarshalBinaryBare` instead of `(Un)MarshalBinaryLengthPrefixed` in all cases that are not needed.


### Improvements

Expand Down
2 changes: 1 addition & 1 deletion baseapp/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ func handleQueryApp(app *BaseApp, path []string, req abci.RequestQuery) abci.Res
return abci.ResponseQuery{
Codespace: sdkerrors.RootCodespace,
Height: req.Height,
Value: codec.Cdc.MustMarshalBinaryLengthPrefixed(gInfo.GasUsed),
Value: codec.Cdc.MustMarshalBinaryBare(gInfo.GasUsed),
}

case "version":
Expand Down
30 changes: 15 additions & 15 deletions baseapp/baseapp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ func TestTxDecoder(t *testing.T) {

app := newBaseApp(t.Name())
tx := newTxCounter(1, 0)
txBytes := codec.MustMarshalBinaryLengthPrefixed(tx)
txBytes := codec.MustMarshalBinaryBare(tx)

dTx, err := app.txDecoder(txBytes)
require.NoError(t, err)
Expand Down Expand Up @@ -625,7 +625,7 @@ func testTxDecoder(cdc *codec.Codec) sdk.TxDecoder {
return nil, sdkerrors.Wrap(sdkerrors.ErrTxDecode, "tx bytes are empty")
}

err := cdc.UnmarshalBinaryLengthPrefixed(txBytes, &tx)
err := cdc.UnmarshalBinaryBare(txBytes, &tx)
if err != nil {
return nil, sdkerrors.ErrTxDecode
}
Expand Down Expand Up @@ -733,7 +733,7 @@ func TestCheckTx(t *testing.T) {

for i := int64(0); i < nTxs; i++ {
tx := newTxCounter(i, 0)
txBytes, err := codec.MarshalBinaryLengthPrefixed(tx)
txBytes, err := codec.MarshalBinaryBare(tx)
require.NoError(t, err)
r := app.CheckTx(abci.RequestCheckTx{Tx: txBytes})
assert.True(t, r.IsOK(), fmt.Sprintf("%v", r))
Expand Down Expand Up @@ -787,7 +787,7 @@ func TestDeliverTx(t *testing.T) {
counter := int64(blockN*txPerHeight + i)
tx := newTxCounter(counter, counter)

txBytes, err := codec.MarshalBinaryLengthPrefixed(tx)
txBytes, err := codec.MarshalBinaryBare(tx)
require.NoError(t, err)

res := app.DeliverTx(abci.RequestDeliverTx{Tx: txBytes})
Expand Down Expand Up @@ -831,7 +831,7 @@ func TestMultiMsgDeliverTx(t *testing.T) {
header := abci.Header{Height: 1}
app.BeginBlock(abci.RequestBeginBlock{Header: header})
tx := newTxCounter(0, 0, 1, 2)
txBytes, err := codec.MarshalBinaryLengthPrefixed(tx)
txBytes, err := codec.MarshalBinaryBare(tx)
require.NoError(t, err)
res := app.DeliverTx(abci.RequestDeliverTx{Tx: txBytes})
require.True(t, res.IsOK(), fmt.Sprintf("%v", res))
Expand All @@ -851,7 +851,7 @@ func TestMultiMsgDeliverTx(t *testing.T) {
tx = newTxCounter(1, 3)
tx.Msgs = append(tx.Msgs, msgCounter2{0})
tx.Msgs = append(tx.Msgs, msgCounter2{1})
txBytes, err = codec.MarshalBinaryLengthPrefixed(tx)
txBytes, err = codec.MarshalBinaryBare(tx)
require.NoError(t, err)
res = app.DeliverTx(abci.RequestDeliverTx{Tx: txBytes})
require.True(t, res.IsOK(), fmt.Sprintf("%v", res))
Expand Down Expand Up @@ -912,7 +912,7 @@ func TestSimulateTx(t *testing.T) {
app.BeginBlock(abci.RequestBeginBlock{Header: header})

tx := newTxCounter(count, count)
txBytes, err := cdc.MarshalBinaryLengthPrefixed(tx)
txBytes, err := cdc.MarshalBinaryBare(tx)
require.Nil(t, err)

// simulate a message, check gas reported
Expand All @@ -936,7 +936,7 @@ func TestSimulateTx(t *testing.T) {
require.True(t, queryResult.IsOK(), queryResult.Log)

var res uint64
err = codec.Cdc.UnmarshalBinaryLengthPrefixed(queryResult.Value, &res)
err = codec.Cdc.UnmarshalBinaryBare(queryResult.Value, &res)
require.NoError(t, err)
require.Equal(t, gasConsumed, res)
app.EndBlock(abci.RequestEndBlock{})
Expand Down Expand Up @@ -1036,7 +1036,7 @@ func TestRunInvalidTransaction(t *testing.T) {
registerTestCodec(newCdc)
newCdc.RegisterConcrete(&msgNoDecode{}, "cosmos-sdk/baseapp/msgNoDecode", nil)

txBytes, err := newCdc.MarshalBinaryLengthPrefixed(tx)
txBytes, err := newCdc.MarshalBinaryBare(tx)
require.NoError(t, err)

res := app.DeliverTx(abci.RequestDeliverTx{Tx: txBytes})
Expand Down Expand Up @@ -1259,7 +1259,7 @@ func TestBaseAppAnteHandler(t *testing.T) {
// the next txs ante handler execution (anteHandlerTxTest).
tx := newTxCounter(0, 0)
tx.setFailOnAnte(true)
txBytes, err := cdc.MarshalBinaryLengthPrefixed(tx)
txBytes, err := cdc.MarshalBinaryBare(tx)
require.NoError(t, err)
res := app.DeliverTx(abci.RequestDeliverTx{Tx: txBytes})
require.False(t, res.IsOK(), fmt.Sprintf("%v", res))
Expand All @@ -1273,7 +1273,7 @@ func TestBaseAppAnteHandler(t *testing.T) {
tx = newTxCounter(0, 0)
tx.setFailOnHandler(true)

txBytes, err = cdc.MarshalBinaryLengthPrefixed(tx)
txBytes, err = cdc.MarshalBinaryBare(tx)
require.NoError(t, err)

res = app.DeliverTx(abci.RequestDeliverTx{Tx: txBytes})
Expand All @@ -1288,7 +1288,7 @@ func TestBaseAppAnteHandler(t *testing.T) {
// implicitly checked by previous tx executions
tx = newTxCounter(1, 0)

txBytes, err = cdc.MarshalBinaryLengthPrefixed(tx)
txBytes, err = cdc.MarshalBinaryBare(tx)
require.NoError(t, err)

res = app.DeliverTx(abci.RequestDeliverTx{Tx: txBytes})
Expand Down Expand Up @@ -1359,15 +1359,15 @@ func TestGasConsumptionBadTx(t *testing.T) {

tx := newTxCounter(5, 0)
tx.setFailOnAnte(true)
txBytes, err := cdc.MarshalBinaryLengthPrefixed(tx)
txBytes, err := cdc.MarshalBinaryBare(tx)
require.NoError(t, err)

res := app.DeliverTx(abci.RequestDeliverTx{Tx: txBytes})
require.False(t, res.IsOK(), fmt.Sprintf("%v", res))

// require next tx to fail due to black gas limit
tx = newTxCounter(5, 0)
txBytes, err = cdc.MarshalBinaryLengthPrefixed(tx)
txBytes, err = cdc.MarshalBinaryBare(tx)
require.NoError(t, err)

res = app.DeliverTx(abci.RequestDeliverTx{Tx: txBytes})
Expand Down Expand Up @@ -1529,7 +1529,7 @@ func TestWithRouter(t *testing.T) {
counter := int64(blockN*txPerHeight + i)
tx := newTxCounter(counter, counter)

txBytes, err := codec.MarshalBinaryLengthPrefixed(tx)
txBytes, err := codec.MarshalBinaryBare(tx)
require.NoError(t, err)

res := app.DeliverTx(abci.RequestDeliverTx{Tx: txBytes})
Expand Down
2 changes: 1 addition & 1 deletion client/context/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (ctx CLIContext) QuerySubspace(subspace []byte, storeName string) (res []sd
return res, height, err
}

ctx.Codec.MustUnmarshalBinaryLengthPrefixed(resRaw, &res)
ctx.Codec.MustUnmarshalBinaryBare(resRaw, &res)
return
}

Expand Down
16 changes: 8 additions & 8 deletions codec/std/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ func (c *Codec) MarshalAccount(accI authexported.Account) ([]byte, error) {
return nil, err
}

return c.Marshaler.MarshalBinaryLengthPrefixed(acc)
return c.Marshaler.MarshalBinaryBare(acc)
}

// UnmarshalAccount returns an Account interface from raw encoded account bytes
// of a Proto-based Account type. An error is returned upon decoding failure.
func (c *Codec) UnmarshalAccount(bz []byte) (authexported.Account, error) {
acc := &Account{}
if err := c.Marshaler.UnmarshalBinaryLengthPrefixed(bz, acc); err != nil {
if err := c.Marshaler.UnmarshalBinaryBare(bz, acc); err != nil {
return nil, err
}

Expand Down Expand Up @@ -83,14 +83,14 @@ func (c *Codec) MarshalSupply(supplyI supplyexported.SupplyI) ([]byte, error) {
return nil, err
}

return c.Marshaler.MarshalBinaryLengthPrefixed(supply)
return c.Marshaler.MarshalBinaryBare(supply)
}

// UnmarshalSupply returns a SupplyI interface from raw encoded account bytes
// of a Proto-based SupplyI type. An error is returned upon decoding failure.
func (c *Codec) UnmarshalSupply(bz []byte) (supplyexported.SupplyI, error) {
supply := &Supply{}
if err := c.Marshaler.UnmarshalBinaryLengthPrefixed(bz, supply); err != nil {
if err := c.Marshaler.UnmarshalBinaryBare(bz, supply); err != nil {
return nil, err
}

Expand Down Expand Up @@ -122,15 +122,15 @@ func (c *Codec) MarshalEvidence(evidenceI eviexported.Evidence) ([]byte, error)
return nil, err
}

return c.Marshaler.MarshalBinaryLengthPrefixed(evidence)
return c.Marshaler.MarshalBinaryBare(evidence)
}

// UnmarshalEvidence returns an Evidence interface from raw encoded evidence
// bytes of a Proto-based Evidence type. An error is returned upon decoding
// failure.
func (c *Codec) UnmarshalEvidence(bz []byte) (eviexported.Evidence, error) {
evidence := &Evidence{}
if err := c.Marshaler.UnmarshalBinaryLengthPrefixed(bz, evidence); err != nil {
if err := c.Marshaler.UnmarshalBinaryBare(bz, evidence); err != nil {
return nil, err
}

Expand Down Expand Up @@ -162,15 +162,15 @@ func (c *Codec) MarshalProposal(p gov.Proposal) ([]byte, error) {
return nil, err
}

return c.Marshaler.MarshalBinaryLengthPrefixed(proposal)
return c.Marshaler.MarshalBinaryBare(proposal)
}

// UnmarshalProposal decodes a Proposal defined by the x/gov module and uses the
// application-level Proposal type which has the concrete Content implementation
// to deserialize.
func (c *Codec) UnmarshalProposal(bz []byte) (gov.Proposal, error) {
proposal := &Proposal{}
if err := c.Marshaler.UnmarshalBinaryLengthPrefixed(bz, proposal); err != nil {
if err := c.Marshaler.UnmarshalBinaryBare(bz, proposal); err != nil {
return gov.Proposal{}, err
}

Expand Down
2 changes: 1 addition & 1 deletion crypto/keys/keybase_base.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func (kb baseKeybase) DecodeSignature(info Info, msg []byte) (sig []byte, pub tm
return nil, nil, err
}

if err := CryptoCdc.UnmarshalBinaryLengthPrefixed([]byte(signed), sig); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @jgimeno, I skimmed through and didn't realize you also updated the Keybase. The Keybase should not be updated because than that will break existing local wallets. Let's undo these.

if err := CryptoCdc.UnmarshalBinaryBare([]byte(signed), sig); err != nil {
return nil, nil, errors.Wrap(err, "failed to decode signature")
}

Expand Down
4 changes: 2 additions & 2 deletions crypto/keys/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,12 +337,12 @@ func (i multiInfo) GetPath() (*hd.BIP44Params, error) {

// encoding info
func marshalInfo(i Info) []byte {
return CryptoCdc.MustMarshalBinaryLengthPrefixed(i)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return CryptoCdc.MustMarshalBinaryBare(i)
}

// decoding info
func unmarshalInfo(bz []byte) (info Info, err error) {
err = CryptoCdc.UnmarshalBinaryLengthPrefixed(bz, &info)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

err = CryptoCdc.UnmarshalBinaryBare(bz, &info)
return
}

Expand Down
6 changes: 3 additions & 3 deletions docs/architecture/adr-019-protobuf-state-encoding.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Example:
// ...
}

bz := cdc.MustMarshalBinaryLengthPrefixed(ts)
bz := cdc.MustMarshalBinaryBare(ts)
```

However, modules can vary greatly in purpose and design and so we must support the ability for modules
Expand Down Expand Up @@ -161,12 +161,12 @@ func (c *Codec) MarshalAccount(accI authexported.Account) ([]byte, error) {
return nil, err
}

return c.Marshaler.MarshalBinaryLengthPrefixed(acc)
return c.Marshaler.MarshalBinaryBare(acc)
}

func (c *Codec) UnmarshalAccount(bz []byte) (authexported.Account, error) {
acc := &Account{}
if err := c.Marshaler.UnmarshalBinaryLengthPrefixed(bz, acc); err != nil {
if err := c.Marshaler.UnmarshalBinaryBare(bz, acc); err != nil {
return nil, err
}

Expand Down
2 changes: 1 addition & 1 deletion docs/core/store.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ iterator := sdk.KVStorePrefixIterator(store, prefix) // proxy for store.Iterator
defer iterator.Close()
for ; iterator.Valid(); iterator.Next() {
var object types.Object
keeper.cdc.MustUnmarshalBinaryLengthPrefixed(iterator.Value(), &object)
keeper.cdc.MustUnmarshalBinaryBare(iterator.Value(), &object)

if cb(object) {
break
Expand Down
2 changes: 1 addition & 1 deletion simapp/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ func SignCheckDeliver(
priv...,
)

txBytes, err := cdc.MarshalBinaryLengthPrefixed(tx)
txBytes, err := cdc.MarshalBinaryBare(tx)
require.Nil(t, err)

// Must simulate now as CheckTx doesn't run Msgs anymore
Expand Down
2 changes: 1 addition & 1 deletion simapp/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestGetSimulationLog(t *testing.T) {
},
{
auth.StoreKey,
[]tmkv.Pair{{Key: auth.GlobalAccountNumberKey, Value: cdc.MustMarshalBinaryLengthPrefixed(uint64(10))}},
[]tmkv.Pair{{Key: auth.GlobalAccountNumberKey, Value: cdc.MustMarshalBinaryBare(uint64(10))}},
"10",
},
{
Expand Down
2 changes: 1 addition & 1 deletion store/iavl/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ func (st *Store) Query(req abci.RequestQuery) (res abci.ResponseQuery) {
}

iterator.Close()
res.Value = cdc.MustMarshalBinaryLengthPrefixed(KVs)
res.Value = cdc.MustMarshalBinaryBare(KVs)

default:
return sdkerrors.QueryResult(sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unexpected query path: %v", req.Path))
Expand Down
6 changes: 3 additions & 3 deletions store/iavl/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -521,9 +521,9 @@ func TestIAVLStoreQuery(t *testing.T) {
{Key: k1, Value: v3},
{Key: k2, Value: v2},
}
valExpSubEmpty := cdc.MustMarshalBinaryLengthPrefixed(KVs0)
valExpSub1 := cdc.MustMarshalBinaryLengthPrefixed(KVs1)
valExpSub2 := cdc.MustMarshalBinaryLengthPrefixed(KVs2)
valExpSubEmpty := cdc.MustMarshalBinaryBare(KVs0)
valExpSub1 := cdc.MustMarshalBinaryBare(KVs1)
valExpSub2 := cdc.MustMarshalBinaryBare(KVs2)

cid := iavlStore.Commit()
ver := cid.Version
Expand Down
4 changes: 2 additions & 2 deletions store/rootmulti/proof.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func MultiStoreProofOpDecoder(pop merkle.ProofOp) (merkle.ProofOperator, error)
// XXX: a bit strange as we'll discard this, but it works
var op MultiStoreProofOp

err := cdc.UnmarshalBinaryLengthPrefixed(pop.Data, &op)
err := cdc.UnmarshalBinaryBare(pop.Data, &op)
if err != nil {
return nil, fmt.Errorf("decoding ProofOp.Data into MultiStoreProofOp: %w", err)
}
Expand All @@ -79,7 +79,7 @@ func MultiStoreProofOpDecoder(pop merkle.ProofOp) (merkle.ProofOperator, error)
// ProofOp return a merkle proof operation from a given multi-store proof
// operation.
func (op MultiStoreProofOp) ProofOp() merkle.ProofOp {
bz := cdc.MustMarshalBinaryLengthPrefixed(op)
bz := cdc.MustMarshalBinaryBare(op)
return merkle.ProofOp{
Type: ProofOpMultiStore,
Key: op.key,
Expand Down
8 changes: 4 additions & 4 deletions store/rootmulti/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ func getLatestVersion(db dbm.DB) int64 {
return 0
}

err = cdc.UnmarshalBinaryLengthPrefixed(latestBytes, &latest)
err = cdc.UnmarshalBinaryBare(latestBytes, &latest)
if err != nil {
panic(err)
}
Expand All @@ -627,7 +627,7 @@ func getLatestVersion(db dbm.DB) int64 {

// Set the latest version.
func setLatestVersion(batch dbm.Batch, version int64) {
latestBytes, _ := cdc.MarshalBinaryLengthPrefixed(version)
latestBytes, _ := cdc.MarshalBinaryBare(version)
batch.Set([]byte(latestVersionKey), latestBytes)
}

Expand Down Expand Up @@ -668,7 +668,7 @@ func getCommitInfo(db dbm.DB, ver int64) (commitInfo, error) {

var cInfo commitInfo

err = cdc.UnmarshalBinaryLengthPrefixed(cInfoBytes, &cInfo)
err = cdc.UnmarshalBinaryBare(cInfoBytes, &cInfo)
if err != nil {
return commitInfo{}, errors.Wrap(err, "failed to get store")
}
Expand All @@ -678,7 +678,7 @@ func getCommitInfo(db dbm.DB, ver int64) (commitInfo, error) {

// Set a commitInfo for given version.
func setCommitInfo(batch dbm.Batch, version int64, cInfo commitInfo) {
cInfoBytes := cdc.MustMarshalBinaryLengthPrefixed(cInfo)
cInfoBytes := cdc.MustMarshalBinaryBare(cInfo)
cInfoKey := fmt.Sprintf(commitInfoKeyFmt, version)
batch.Set([]byte(cInfoKey), cInfoBytes)
}
Expand Down
2 changes: 1 addition & 1 deletion x/auth/ante/basic.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func (cgts ConsumeTxSizeGasDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, sim
PubKey: pubkey,
}

sigBz := codec.Cdc.MustMarshalBinaryLengthPrefixed(simSig)
sigBz := codec.Cdc.MustMarshalBinaryBare(simSig)
cost := sdk.Gas(len(sigBz) + 6)

// If the pubkey is a multi-signature pubkey, then we estimate for the maximum
Expand Down
2 changes: 1 addition & 1 deletion x/auth/client/cli/broadcast.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ $ <appcli> tx broadcast ./mytxn.json
return
}

txBytes, err := cliCtx.Codec.MarshalBinaryLengthPrefixed(stdTx)
txBytes, err := cliCtx.Codec.MarshalBinaryBare(stdTx)
if err != nil {
return
}
Expand Down
Loading