Skip to content

Commit

Permalink
Revert "feat: Introduce sig block height for the new replay protection (
Browse files Browse the repository at this point in the history
Finschia#265)"

This reverts commit c1c71f1.

# Conflicts:
#	CHANGELOG.md
#	baseapp/msg_service_router_test.go
#	client/tx/tx.go
#	codec/amino_codec_test.go
#	docs/core/proto-docs.md
#	proto/lbm/auth/v1/auth.proto
#	server/grpc/server_test.go
#	simapp/genesis_account_test.go
#	simapp/test_helpers.go
#	testutil/testdata/unknonwnproto.pb.go
#	types/errors/errors.go
#	types/grpc/headers.go
#	types/rest/rest_test.go
#	types/tx/tx.pb.go
#	types/tx/types.go
#	x/auth/ante/ante.go
#	x/auth/ante/ante_test.go
#	x/auth/ante/sigverify_test.go
#	x/auth/ante/testutil_test.go
#	x/auth/client/cli/cli_test.go
#	x/auth/keeper/keeper.go
#	x/auth/legacy/legacytx/amino_signing_test.go
#	x/auth/signing/handler_map_test.go
#	x/auth/signing/verify_test.go
#	x/auth/simulation/decoder.go
#	x/auth/simulation/genesis.go
#	x/auth/tx/builder.go
#	x/auth/tx/direct_test.go
#	x/auth/tx/legacy_amino_json_test.go
#	x/auth/types/account.go
#	x/auth/types/account_retriever.go
#	x/auth/types/account_test.go
#	x/auth/types/auth.pb.go
#	x/auth/types/params.go
#	x/auth/vesting/types/vesting_account.go
#	x/auth/vesting/types/vesting_account_test.go
#	x/evidence/keeper/keeper_test.go
#	x/ibc/testing/chain.go
#	x/wasm/keeper/keeper_test.go
#	x/wasm/keeper/submsg_test.go
  • Loading branch information
zemyblue committed Feb 11, 2022
1 parent 7c10e90 commit f504e28
Show file tree
Hide file tree
Showing 8 changed files with 402 additions and 1,249 deletions.
1,175 changes: 146 additions & 1,029 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/core/proto-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -10168,7 +10168,6 @@ transaction.
| ----- | ---- | ----- | ----------- |
| `signer_infos` | [SignerInfo](#lbm.tx.v1.SignerInfo) | repeated | signer_infos defines the signing modes for the required signers. The number and order of elements must match the required signers from TxBody's messages. The first element is the primary signer and the one which pays the fee. |
| `fee` | [Fee](#lbm.tx.v1.Fee) | | Fee is the fee and gas limit for the transaction. The first signer is the primary signer and the one which pays the fee. The fee can be calculated based on the cost of evaluating the body and doing signature verification of the signers. This can be estimated via simulation. |
| `sig_block_height` | [uint64](#uint64) | | sig block height is available between current block height and current block height - `VALID_SIG_BLOCK_PERIOD` this is used for distinguish signatures instead of account number. this is mandatory. |



Expand Down Expand Up @@ -10305,6 +10304,7 @@ TxBody is the body of a transaction that all signers sign over.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `messages` | [google.protobuf.Any](#google.protobuf.Any) | repeated | messages is a list of messages to be executed. The required signers of those messages define the number and order of elements in AuthInfo's signer_infos and Tx's signatures. Each required signer address is added to the list only the first time it occurs. By convention, the first required signer (usually from the first message) is referred to as the primary signer and pays the fee for the whole transaction. |
| `sig_block_height` | [uint64](#uint64) | | sig block height is available between current block height and current block height - `VALID_SIG_BLOCK_PERIOD` this is used for distinguish signatures instead of account number. this is mandatory. |
| `memo` | [string](#string) | | memo is any arbitrary memo to be added to the transaction |
| `timeout_height` | [uint64](#uint64) | | timeout is the block height after which this transaction will not be processed by the chain |
| `extension_options` | [google.protobuf.Any](#google.protobuf.Any) | repeated | extension_options are arbitrary options that can be added by chains when the default options are not sufficient. If any of these are present and can't be handled, the transaction will be rejected |
Expand Down
12 changes: 6 additions & 6 deletions proto/lbm/tx/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,16 @@ message TxBody {
// transaction.
repeated google.protobuf.Any messages = 1;

// sig block height is available between current block height and current block height - `VALID_SIG_BLOCK_PERIOD`
// this is used for distinguish signatures instead of account number. this is mandatory.
uint64 sig_block_height = 2;

// memo is any arbitrary memo to be added to the transaction
string memo = 2;
string memo = 3;

// timeout is the block height after which this transaction will not
// be processed by the chain
uint64 timeout_height = 3;
uint64 timeout_height = 4;

// extension_options are arbitrary options that can be added by chains
// when the default options are not sufficient. If any of these are present
Expand All @@ -103,10 +107,6 @@ message AuthInfo {
// based on the cost of evaluating the body and doing signature verification
// of the signers. This can be estimated via simulation.
Fee fee = 2;

// sig block height is available between current block height and current block height - `VALID_SIG_BLOCK_PERIOD`
// this is used for distinguish signatures instead of account number. this is mandatory.
uint64 sig_block_height = 3;
}

// SignerInfo describes the public key and signing mode of a single top-level
Expand Down
258 changes: 147 additions & 111 deletions testutil/testdata/unknonwnproto.pb.go

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions testutil/testdata/unknonwnproto.proto
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,10 @@ message TestUpdatedTxRaw {

message TestUpdatedTxBody {
repeated google.protobuf.Any messages = 1;
string memo = 2;
int64 timeout_height = 3;
uint64 some_new_field = 4;
uint64 sig_block_height = 2;
string memo = 3;
int64 timeout_height = 4;
uint64 some_new_field = 5;
string some_new_field_non_critical_field = 1050;
repeated google.protobuf.Any extension_options = 1023;
repeated google.protobuf.Any non_critical_extension_options = 2047;
Expand Down
Loading

0 comments on commit f504e28

Please sign in to comment.