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.
Protobuf definition for Optimint types (cosmos#73)
Protobuf definition for Optimint types
- Loading branch information
Showing
5 changed files
with
1,807 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
# see: https://stackoverflow.com/a/246128 | ||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" | ||
|
||
cd $SCRIPT_DIR | ||
protoc -I=. -I=$GOPATH/src -I=$GOPATH/src/github.com/gogo/protobuf --gofast_out=../types/pb/optimint optimint.proto |
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,73 @@ | ||
syntax = "proto3"; | ||
package optimint; | ||
|
||
// option go_package = "github.com/lazyledger/optimint/proto"; | ||
import "tendermint/abci/types.proto"; | ||
|
||
// Version captures the consensus rules for processing a block in the blockchain, | ||
// including all blockchain data structures and the rules of the application's | ||
// state transition machine. | ||
// This is equivalent to the tmversion.Consensus type in Tendermint. | ||
message Version { | ||
uint32 block = 1; | ||
uint32 app = 2; | ||
} | ||
|
||
message Header { | ||
// Block and App version | ||
Version version = 1; | ||
// NamespaceID identifies this chain e.g. when connected to other rollups via IBC. | ||
bytes namespace_id = 2; | ||
|
||
// Block height | ||
uint64 height = 3; | ||
|
||
// Block creation time | ||
uint64 time = 4; | ||
|
||
// Previous block info | ||
bytes last_header_hash = 5; | ||
|
||
// Commit from aggregator(s) from the last block | ||
bytes last_commit_hash = 6; | ||
|
||
// Block.Data root aka Transactions | ||
bytes data_hash = 7; | ||
|
||
// Consensus params for current block | ||
bytes consensus_hash = 8; | ||
|
||
// State after applying txs from the current block | ||
bytes app_hash = 9; | ||
|
||
// Root hash of all results from the txs from the previous block. | ||
// This is ABCI specific but smart-contract chains require some way of committing | ||
// to transaction receipts/results. | ||
bytes last_results_hash = 10; | ||
|
||
// Original proposer of the block | ||
// Note that the address can be derived from the pubkey which can be derived | ||
// from the signature when using secp256k. | ||
// We keep this in case users choose another signature format where the | ||
// pubkey can't be recovered by the signature (e.g. ed25519). | ||
bytes proposer_address = 11; | ||
} | ||
|
||
message Commit { | ||
uint64 height = 1; | ||
bytes hader_hash = 2; | ||
// Note: most of the time this will be a single sinature | ||
repeated bytes signatures = 3; | ||
} | ||
|
||
message Data { | ||
repeated bytes txs = 1; | ||
repeated bytes intermediate_state_roots = 2; | ||
repeated tendermint.abci.Evidence evidence = 3; | ||
} | ||
|
||
message Block { | ||
Header header = 1; | ||
Data data = 2; | ||
Commit last_commit = 3; | ||
} |
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,44 @@ | ||
syntax = "proto3"; | ||
package tendermint.abci; | ||
|
||
option go_package = "github.com/lazyledger/lazyledger-core/abci/types"; | ||
|
||
// For more information on gogo.proto, see: | ||
// https://github.com/gogo/protobuf/blob/master/extensions.md | ||
import "google/protobuf/timestamp.proto"; | ||
import "gogoproto/gogo.proto"; | ||
|
||
// This file is copied from http://github.com/tendermint/abci | ||
// NOTE: When using custom types, mind the warnings. | ||
// https://github.com/gogo/protobuf/blob/master/custom_types.md#warnings-and-issues | ||
|
||
// Validator | ||
message Validator { | ||
bytes address = 1; // The first 20 bytes of SHA256(public key) | ||
// PubKey pub_key = 2 [(gogoproto.nullable)=false]; | ||
int64 power = 3; // The voting power | ||
} | ||
|
||
enum EvidenceType { | ||
UNKNOWN = 0; | ||
DUPLICATE_VOTE = 1; | ||
LIGHT_CLIENT_ATTACK = 2; | ||
} | ||
|
||
message Evidence { | ||
EvidenceType type = 1; | ||
// The offending validator | ||
Validator validator = 2 [(gogoproto.nullable) = false]; | ||
// The height when the offense occurred | ||
int64 height = 3; | ||
// The corresponding time where the offense occurred | ||
google.protobuf.Timestamp time = 4 [ | ||
(gogoproto.nullable) = false, | ||
(gogoproto.stdtime) = true | ||
]; | ||
// Total voting power of the validator set in case the ABCI application does | ||
// not store historical validators. | ||
// https://github.com/tendermint/tendermint/issues/4581 | ||
int64 total_voting_power = 5; | ||
} | ||
|
Oops, something went wrong.