@ -61,6 +61,23 @@ Each event has a `type` which is meant to categorize the event for a particular
particular event. Every key and value in an event's attributes must be UTF-8
particular event. Every key and value in an event's attributes must be UTF-8
encoded strings along with the event type itself.
encoded strings along with the event type itself.
```protobuf
message Event {
string type = 1;
repeated EventAttribute attributes = 2;
}
```
The attributes of an `Event` consist of a `key`, `value` and a `index`. The index field notifies the indexer within Tendermint to index the event. This field is non-deterministic and will vary across different nodes in the network.
```protobuf
message EventAttribute {
bytes key = 1;
bytes value = 2;
bool index = 3; // nondeterministic
}
```
Example:
Example:
```go
```go
@ -563,12 +580,7 @@ via light client.
### PubKey
### PubKey
- **Fields**:
- **Fields**:
- `Type (string)`: Type of the public key. A simple string like `"ed25519"`.
In the future, may indicate a serialization algorithm to parse the `Data`,
for instance `"amino"`.
- `Data ([]byte)`: Public key data. For a simple public key, it's just the
raw bytes. If the `Type` indicates an encoding algorithm, this is the
encoded public key.
- `Sum (oneof PublicKey)`: This field is a Protobuf [`oneof`](https://developers.google.com/protocol-buffers/docs/proto#oneof)
- **Usage**:
- **Usage**:
- A generic and extensible typed public key
- A generic and extensible typed public key
@ -626,8 +638,8 @@ via light client.
### ValidatorParams
### ValidatorParams
- **Fields**:
- **Fields**:
- `PubKeyTypes ([]string)`: List of accepted pubkey types. Uses same
naming as `PubKey.Type`.
- `PubKeyTypes ([]string)`: List of accepted public key types.
In what follows, we provide the type names and prefix bytes directly.
Notice that when encoding byte-arrays, the length of the byte-array is appended
to the PrefixBytes. Thus the encoding of a byte array becomes `<PrefixBytes> <Length> <ByteArray>`. In other words, to encode any type listed below you do not need to be
familiar with amino encoding.
You can simply use below table and concatenate Prefix || Length (of raw bytes) || raw bytes
`ResponseDeliverTx` is the result of executing a transaction against the application.
It returns a result code (`uint32`), an arbitrary byte array (`[]byte`) (ie. a return value), Log (`string`), Info (`string`), GasWanted (`int64`), GasUsed (`int64`), Events (`[]Events`) and a Codespace (`string`).
### Validator
### Validator
@ -110,45 +113,48 @@ Like validator sets, they are set during genesis and can be updated by the appli
When hashed, only a subset of the params are included, to allow the params to
When hashed, only a subset of the params are included, to allow the params to
evolve without breaking the header.
evolve without breaking the header.
```go
type ConsensusParams struct {
Block
Evidence
Validator
Version
```protobuf
message ConsensusParams {
BlockParams block = 1;
EvidenceParams evidence = 2;
ValidatorParams validator = 3;
VersionParams version = 4;
}
}
```
```go
type hashedParams struct {
type hashedParams struct {
BlockMaxBytes int64
BlockMaxBytes int64
BlockMaxGas int64
BlockMaxGas int64
}
}
func (params ConsensusParams) Hash() []byte {
func HashConsensusParams() []byte {
SHA256(hashedParams{
SHA256(hashedParams{
BlockMaxBytes: params.Block.MaxBytes,
BlockMaxBytes: params.Block.MaxBytes,
BlockMaxGas: params.Block.MaxGas,
BlockMaxGas: params.Block.MaxGas,
})
})
}
}
```
type BlockParams struct {
MaxBytes int64
MaxGas int64
TimeIotaMs int64
```protobuf
message BlockParams {
int64 max_bytes = 1;
int64 max_gas = 2;
int64 time_iota_ms = 3; // not exposed to the application