forked from cosmos/ibc-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: serialize state with protobuf (cosmos#424)
* reproduce state deserialization error * save state regardless of DA submission * serialize state with protobuf * move `State` to `types` package * create protobuf definition for `State` * add `FromProto` and `ToProto` methods * fill validator sets in tests
- Loading branch information
Showing
14 changed files
with
1,604 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env bash | ||
|
||
cd "$(dirname "${BASH_SOURCE[0]}")" | ||
|
||
TM_VERSION=v0.34.14 | ||
TM_PROTO_URL=https://raw.githubusercontent.com/tendermint/tendermint/$TM_VERSION/proto/tendermint | ||
|
||
TM_PROTO_FILES=( | ||
abci/types.proto | ||
version/types.proto | ||
types/types.proto | ||
types/evidence.proto | ||
types/params.proto | ||
types/validator.proto | ||
state/types.proto | ||
crypto/proof.proto | ||
crypto/keys.proto | ||
libs/bits/types.proto | ||
p2p/types.proto | ||
) | ||
|
||
echo Fetching protobuf dependencies from Tendermint $TM_VERSION | ||
for FILE in "${TM_PROTO_FILES[@]}"; do | ||
echo Fetching "$FILE" | ||
mkdir -p "tendermint/$(dirname $FILE)" | ||
curl -sSL "$TM_PROTO_URL/$FILE" > "tendermint/$FILE" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
syntax = "proto3"; | ||
package optimint; | ||
option go_package = "github.com/celestiaorg/optimint/types/pb/optimint"; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "google/protobuf/timestamp.proto"; | ||
import "tendermint/abci/types.proto"; | ||
import "tendermint/types/types.proto"; | ||
import "tendermint/types/validator.proto"; | ||
import "tendermint/types/params.proto"; | ||
import "tendermint/state/types.proto"; | ||
|
||
|
||
message State { | ||
tendermint.state.Version version = 1; | ||
|
||
string chain_id = 2; | ||
int64 initial_height = 3; | ||
|
||
int64 last_block_height = 4; | ||
|
||
tendermint.types.BlockID last_block_id = 5 [(gogoproto.nullable) = false, (gogoproto.customname) = "LastBlockID"]; | ||
google.protobuf.Timestamp last_block_time = 6 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; | ||
|
||
uint64 da_height = 7 [(gogoproto.customname) = "DAHeight"]; | ||
|
||
tendermint.types.ValidatorSet next_validators = 8; | ||
tendermint.types.ValidatorSet validators = 9; | ||
tendermint.types.ValidatorSet last_validators = 10; | ||
int64 last_height_validators_changed = 11; | ||
|
||
tendermint.types.ConsensusParams consensus_params = 12 [(gogoproto.nullable) = false]; | ||
int64 last_height_consensus_params_changed = 13; | ||
|
||
bytes last_results_hash = 14; | ||
|
||
bytes app_hash = 15; | ||
} |
Oops, something went wrong.