Skip to content

Commit 5d6f429

Browse files
authored
chore!: cleanup header unused types (#2766)
<!-- Please read and fill out this form before submitting your PR. Please make sure you have reviewed our contributors guide before submitting your first PR. NOTE: PR titles should follow semantic commits: https://www.conventionalcommits.org/en/v1.0.0/ --> ## Overview <!-- Please provide an explanation of the PR, including the appropriate context, background, goal, and rationale. If there is an issue with this information, please provide a tl;dr and link the issue. Ex: Closes #<issue number> --> remove unused fields in header
1 parent 1890a37 commit 5d6f429

32 files changed

+158
-272
lines changed

block/internal/executing/executor.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ func (e *Executor) Stop() error {
149149
func (e *Executor) GetLastState() types.State {
150150
state := e.getLastState()
151151
state.AppHash = bytes.Clone(state.AppHash)
152-
state.LastResultsHash = bytes.Clone(state.LastResultsHash)
153152

154153
return state
155154
}
@@ -512,7 +511,6 @@ func (e *Executor) createBlock(ctx context.Context, height uint64, batchData *Ba
512511
Time: headerTime,
513512
},
514513
LastHeaderHash: lastHeaderHash,
515-
ConsensusHash: make(types.Hash, 32),
516514
AppHash: currentState.AppHash,
517515
ProposerAddress: e.genesis.ProposerAddress,
518516
ValidatorHash: validatorHash,

block/internal/executing/executor_restart_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ func TestExecutor_RestartUsesPendingHeader(t *testing.T) {
129129
Time: uint64(time.Now().UnixNano()),
130130
},
131131
LastHeaderHash: originalHeader.Hash(),
132-
ConsensusHash: make(types.Hash, 32),
133132
AppHash: currentState.AppHash,
134133
ProposerAddress: gen.ProposerAddress,
135134
ValidatorHash: validatorHash,

block/internal/syncing/syncer.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ func (s *Syncer) GetLastState() types.State {
158158

159159
stateCopy := *state
160160
stateCopy.AppHash = bytes.Clone(state.AppHash)
161-
stateCopy.LastResultsHash = bytes.Clone(state.LastResultsHash)
162161

163162
return stateCopy
164163
}

client/crates/types/src/proto/evnode.v1.messages.rs

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ pub struct GetPublicResponse {
2424
#[prost(bytes = "vec", tag = "1")]
2525
pub public_key: ::prost::alloc::vec::Vec<u8>,
2626
}
27-
/// Version captures the consensus rules for processing a block in the blockchain,
28-
/// including all blockchain data structures and the rules of the application's
29-
/// state transition machine.
30-
/// This is equivalent to the tmversion.Consensus type in Tendermint.
27+
/// Version captures the consensus rules for processing a block in the
28+
/// blockchain, including all blockchain data structures and the rules of the
29+
/// application's state transition machine. This is equivalent to the
30+
/// tmversion.Consensus type in Tendermint.
3131
#[allow(clippy::derive_partial_eq_without_eq)]
3232
#[derive(Clone, PartialEq, ::prost::Message)]
3333
pub struct Version {
@@ -52,23 +52,12 @@ pub struct Header {
5252
/// Previous block info
5353
#[prost(bytes = "vec", tag = "4")]
5454
pub last_header_hash: ::prost::alloc::vec::Vec<u8>,
55-
/// Commit from aggregator(s) from the last block
56-
#[prost(bytes = "vec", tag = "5")]
57-
pub last_commit_hash: ::prost::alloc::vec::Vec<u8>,
5855
/// Block.Data root aka Transactions
5956
#[prost(bytes = "vec", tag = "6")]
6057
pub data_hash: ::prost::alloc::vec::Vec<u8>,
61-
/// Consensus params for current block
62-
#[prost(bytes = "vec", tag = "7")]
63-
pub consensus_hash: ::prost::alloc::vec::Vec<u8>,
6458
/// State after applying txs from the current block
6559
#[prost(bytes = "vec", tag = "8")]
6660
pub app_hash: ::prost::alloc::vec::Vec<u8>,
67-
/// Root hash of all results from the txs from the previous block.
68-
/// This is ABCI specific but smart-contract chains require some way of committing
69-
/// to transaction receipts/results.
70-
#[prost(bytes = "vec", tag = "9")]
71-
pub last_results_hash: ::prost::alloc::vec::Vec<u8>,
7261
/// Original proposer of the block
7362
/// Note that the address can be derived from the pubkey which can be derived
7463
/// from the signature when using secp256k.
@@ -178,8 +167,6 @@ pub struct State {
178167
pub last_block_time: ::core::option::Option<::prost_types::Timestamp>,
179168
#[prost(uint64, tag = "6")]
180169
pub da_height: u64,
181-
#[prost(bytes = "vec", tag = "7")]
182-
pub last_results_hash: ::prost::alloc::vec::Vec<u8>,
183170
#[prost(bytes = "vec", tag = "8")]
184171
pub app_hash: ::prost::alloc::vec::Vec<u8>,
185172
}
@@ -418,6 +405,13 @@ pub struct GetMetadataResponse {
418405
#[prost(bytes = "vec", tag = "1")]
419406
pub value: ::prost::alloc::vec::Vec<u8>,
420407
}
408+
/// GetGenesisDaHeightResponse defines the DA height at which the first Evolve block was included.
409+
#[allow(clippy::derive_partial_eq_without_eq)]
410+
#[derive(Clone, PartialEq, ::prost::Message)]
411+
pub struct GetGenesisDaHeightResponse {
412+
#[prost(uint64, tag = "3")]
413+
pub height: u64,
414+
}
421415
/// GetNamespaceResponse returns the namespace for this network
422416
#[allow(clippy::derive_partial_eq_without_eq)]
423417
#[derive(Clone, PartialEq, ::prost::Message)]

client/crates/types/src/proto/evnode.v1.services.rs

Lines changed: 89 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -394,10 +394,10 @@ pub mod signer_service_server {
394394
const NAME: &'static str = "evnode.v1.SignerService";
395395
}
396396
}
397-
/// Version captures the consensus rules for processing a block in the blockchain,
398-
/// including all blockchain data structures and the rules of the application's
399-
/// state transition machine.
400-
/// This is equivalent to the tmversion.Consensus type in Tendermint.
397+
/// Version captures the consensus rules for processing a block in the
398+
/// blockchain, including all blockchain data structures and the rules of the
399+
/// application's state transition machine. This is equivalent to the
400+
/// tmversion.Consensus type in Tendermint.
401401
#[allow(clippy::derive_partial_eq_without_eq)]
402402
#[derive(Clone, PartialEq, ::prost::Message)]
403403
pub struct Version {
@@ -422,23 +422,12 @@ pub struct Header {
422422
/// Previous block info
423423
#[prost(bytes = "vec", tag = "4")]
424424
pub last_header_hash: ::prost::alloc::vec::Vec<u8>,
425-
/// Commit from aggregator(s) from the last block
426-
#[prost(bytes = "vec", tag = "5")]
427-
pub last_commit_hash: ::prost::alloc::vec::Vec<u8>,
428425
/// Block.Data root aka Transactions
429426
#[prost(bytes = "vec", tag = "6")]
430427
pub data_hash: ::prost::alloc::vec::Vec<u8>,
431-
/// Consensus params for current block
432-
#[prost(bytes = "vec", tag = "7")]
433-
pub consensus_hash: ::prost::alloc::vec::Vec<u8>,
434428
/// State after applying txs from the current block
435429
#[prost(bytes = "vec", tag = "8")]
436430
pub app_hash: ::prost::alloc::vec::Vec<u8>,
437-
/// Root hash of all results from the txs from the previous block.
438-
/// This is ABCI specific but smart-contract chains require some way of committing
439-
/// to transaction receipts/results.
440-
#[prost(bytes = "vec", tag = "9")]
441-
pub last_results_hash: ::prost::alloc::vec::Vec<u8>,
442431
/// Original proposer of the block
443432
/// Note that the address can be derived from the pubkey which can be derived
444433
/// from the signature when using secp256k.
@@ -548,8 +537,6 @@ pub struct State {
548537
pub last_block_time: ::core::option::Option<::prost_types::Timestamp>,
549538
#[prost(uint64, tag = "6")]
550539
pub da_height: u64,
551-
#[prost(bytes = "vec", tag = "7")]
552-
pub last_results_hash: ::prost::alloc::vec::Vec<u8>,
553540
#[prost(bytes = "vec", tag = "8")]
554541
pub app_hash: ::prost::alloc::vec::Vec<u8>,
555542
}
@@ -1978,6 +1965,13 @@ pub struct GetMetadataResponse {
19781965
#[prost(bytes = "vec", tag = "1")]
19791966
pub value: ::prost::alloc::vec::Vec<u8>,
19801967
}
1968+
/// GetGenesisDaHeightResponse defines the DA height at which the first Evolve block was included.
1969+
#[allow(clippy::derive_partial_eq_without_eq)]
1970+
#[derive(Clone, PartialEq, ::prost::Message)]
1971+
pub struct GetGenesisDaHeightResponse {
1972+
#[prost(uint64, tag = "3")]
1973+
pub height: u64,
1974+
}
19811975
/// Generated client implementations.
19821976
pub mod store_service_client {
19831977
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
@@ -2142,6 +2136,32 @@ pub mod store_service_client {
21422136
.insert(GrpcMethod::new("evnode.v1.StoreService", "GetMetadata"));
21432137
self.inner.unary(req, path, codec).await
21442138
}
2139+
/// GetGenesisDaHeight returns the DA height at which the first Evolve block was included.
2140+
pub async fn get_genesis_da_height(
2141+
&mut self,
2142+
request: impl tonic::IntoRequest<()>,
2143+
) -> std::result::Result<
2144+
tonic::Response<super::GetGenesisDaHeightResponse>,
2145+
tonic::Status,
2146+
> {
2147+
self.inner
2148+
.ready()
2149+
.await
2150+
.map_err(|e| {
2151+
tonic::Status::new(
2152+
tonic::Code::Unknown,
2153+
format!("Service was not ready: {}", e.into()),
2154+
)
2155+
})?;
2156+
let codec = tonic::codec::ProstCodec::default();
2157+
let path = http::uri::PathAndQuery::from_static(
2158+
"/evnode.v1.StoreService/GetGenesisDaHeight",
2159+
);
2160+
let mut req = request.into_request();
2161+
req.extensions_mut()
2162+
.insert(GrpcMethod::new("evnode.v1.StoreService", "GetGenesisDaHeight"));
2163+
self.inner.unary(req, path, codec).await
2164+
}
21452165
}
21462166
}
21472167
/// Generated server implementations.
@@ -2175,6 +2195,14 @@ pub mod store_service_server {
21752195
tonic::Response<super::GetMetadataResponse>,
21762196
tonic::Status,
21772197
>;
2198+
/// GetGenesisDaHeight returns the DA height at which the first Evolve block was included.
2199+
async fn get_genesis_da_height(
2200+
&self,
2201+
request: tonic::Request<()>,
2202+
) -> std::result::Result<
2203+
tonic::Response<super::GetGenesisDaHeightResponse>,
2204+
tonic::Status,
2205+
>;
21782206
}
21792207
/// StoreService defines the RPC service for the store package
21802208
#[derive(Debug)]
@@ -2389,6 +2417,48 @@ pub mod store_service_server {
23892417
};
23902418
Box::pin(fut)
23912419
}
2420+
"/evnode.v1.StoreService/GetGenesisDaHeight" => {
2421+
#[allow(non_camel_case_types)]
2422+
struct GetGenesisDaHeightSvc<T: StoreService>(pub Arc<T>);
2423+
impl<T: StoreService> tonic::server::UnaryService<()>
2424+
for GetGenesisDaHeightSvc<T> {
2425+
type Response = super::GetGenesisDaHeightResponse;
2426+
type Future = BoxFuture<
2427+
tonic::Response<Self::Response>,
2428+
tonic::Status,
2429+
>;
2430+
fn call(&mut self, request: tonic::Request<()>) -> Self::Future {
2431+
let inner = Arc::clone(&self.0);
2432+
let fut = async move {
2433+
<T as StoreService>::get_genesis_da_height(&inner, request)
2434+
.await
2435+
};
2436+
Box::pin(fut)
2437+
}
2438+
}
2439+
let accept_compression_encodings = self.accept_compression_encodings;
2440+
let send_compression_encodings = self.send_compression_encodings;
2441+
let max_decoding_message_size = self.max_decoding_message_size;
2442+
let max_encoding_message_size = self.max_encoding_message_size;
2443+
let inner = self.inner.clone();
2444+
let fut = async move {
2445+
let inner = inner.0;
2446+
let method = GetGenesisDaHeightSvc(inner);
2447+
let codec = tonic::codec::ProstCodec::default();
2448+
let mut grpc = tonic::server::Grpc::new(codec)
2449+
.apply_compression_config(
2450+
accept_compression_encodings,
2451+
send_compression_encodings,
2452+
)
2453+
.apply_max_message_size_config(
2454+
max_decoding_message_size,
2455+
max_encoding_message_size,
2456+
);
2457+
let res = grpc.unary(method, req).await;
2458+
Ok(res)
2459+
};
2460+
Box::pin(fut)
2461+
}
23922462
_ => {
23932463
Box::pin(async move {
23942464
Ok(
@@ -2558,7 +2628,7 @@ pub mod config_service_client {
25582628
.insert(GrpcMethod::new("evnode.v1.ConfigService", "GetNamespace"));
25592629
self.inner.unary(req, path, codec).await
25602630
}
2561-
/// GetSequencerInfo returns information about the sequencer
2631+
/// GetSignerInfo returns information about the signer
25622632
pub async fn get_signer_info(
25632633
&mut self,
25642634
request: impl tonic::IntoRequest<()>,
@@ -2601,7 +2671,7 @@ pub mod config_service_server {
26012671
tonic::Response<super::GetNamespaceResponse>,
26022672
tonic::Status,
26032673
>;
2604-
/// GetSequencerInfo returns information about the sequencer
2674+
/// GetSignerInfo returns information about the signer
26052675
async fn get_signer_info(
26062676
&self,
26072677
request: tonic::Request<()>,

docs/adr/adr-004-core-types.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,9 @@ type Header struct {
5656
LastHeaderHash [32]byte
5757

5858
// hashes of block data
59-
LastCommitHash [32]byte // commit from aggregator(s) from the last block
6059
DataHash [32]byte // Block.Data root aka Transactions
61-
ConsensusHash [32]byte // consensus params for current block
6260
AppHash [32]byte // state after applying txs from the current block
6361

64-
// root hash of all results from the txs from the previous block
65-
// This is ABCI specific but smart-contract chains require some way of committing to transaction receipts/results.
66-
LastResultsHash [32]byte
67-
6862

6963
// Note that the address can be derived from the pubkey which can be derived
7064
// from the signature when using secp256k.

docs/adr/adr-015-rollkit-minimal-header.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,10 @@ This minimal Rollkit header can be transformed to be tailored to a specific exec
106106
This header can be transformed into an ABCI-specific header for IBC compatibility.
107107

108108
- `Version`: Required by IBC clients to correctly interpret the block's structure and contents.
109-
- `LastCommitHash`: The hash of the previous block's commit, used by IBC clients to verify the legitimacy of the block's state transitions.
110109
- `DataHash`: A hash of the block's transaction data, enabling IBC clients to verify that the data has not been tampered with. Can be constructed from unpacking the `DataCommitment` in Rollkit header.
111110
- `ValidatorHash`: Current validator set's hash, which IBC clients use to verify that the block was validated by the correct set of validators. This can be the IBC attester set of the chain for backward compatibility with the IBC Tendermint client, if needed.
112111
- `NextValidatorsHash`: The hash of the next validator set, allowing IBC clients to anticipate and verify upcoming validators.
113-
- `ConsensusHash`: Denotes the hash of the consensus parameters, ensuring that IBC clients are aligned with the consensus rules of the blockchain.
114112
- `AppHash`: Same as the `StateRoot` in the Rollkit Header.
115-
- `EvidenceHash`: A hash of evidence of any misbehavior by validators, which IBC clients use to assess the trustworthiness of the validator set.
116-
- `LastResultsHash`: Root hash of all results from the transactions from the previous block.
117113
- `ProposerAddress`: The address of the block proposer, allowing IBC clients to track and verify the entities proposing new blocks. Can be constructed from the `extraData` field in the Rollkit Header.
118114

119115
#### Transformation to ABCI Header
@@ -139,18 +135,10 @@ This header can be transformed into an ABCI-specific header for IBC compatibilit
139135
├─────────────────────┼───────────────────────┤
140136
│ Version │ Added for IBC │
141137
├─────────────────────┼───────────────────────┤
142-
│ LastCommitHash │ Added for IBC │
143-
├─────────────────────┼───────────────────────┤
144138
│ ValidatorHash │ Added for IBC │
145139
├─────────────────────┼───────────────────────┤
146140
│ NextValidatorsHash │ Added for IBC │
147141
├─────────────────────┼───────────────────────┤
148-
│ ConsensusHash │ Added for IBC │
149-
├─────────────────────┼───────────────────────┤
150-
│ EvidenceHash │ Added for IBC │
151-
├─────────────────────┼───────────────────────┤
152-
│ LastResultsHash │ Added for IBC │
153-
├─────────────────────┼───────────────────────┤
154142
│ ProposerAddress │ From ExtraData │
155143
└─────────────────────┴───────────────────────┘
156144
```

docs/learn/specs/block-validity.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@ SignedHeader.Verify(untrustedHeader *SignedHeader)
7878
return error "headers are not adjacent"
7979
// Verify the link to previous header
8080
verify untrustedHeader.LastHeaderHash == h.Header.Hash()
81-
// Verify LastCommit hash matches previous signature
82-
verify untrustedHeader.LastCommitHash == sh.Signature.GetCommitHash(...)
8381
// Note: ValidatorHash field exists for compatibility but is not validated
8482
```
8583

@@ -112,11 +110,8 @@ SignedHeader.Verify(untrustedHeader *SignedHeader)
112110
| **Header** . | | |
113111
| Version | unused | |
114112
| LastHeaderHash | The hash of the previous accepted block | checked in the `Verify()`` step |
115-
| LastCommitHash | The hash of the previous accepted block's commit | checked in the `Verify()`` step |
116113
| DataHash | Correct hash of the block's Data field | checked in the `ValidateBasic()`` step |
117-
| ConsensusHash | unused | |
118114
| AppHash | The correct state root after executing the block's transactions against the accepted state | checked during block execution |
119-
| LastResultsHash | Correct results from executing transactions | checked during block execution |
120115
| ProposerAddress | Address of the expected proposer | Must match Signer.Address in SignedHeader |
121116
| ValidatorHash | Compatibility field for Tendermint light client | Not validated |
122117

docs/src/openapi-rpc.json

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -781,31 +781,16 @@
781781
"format": "byte",
782782
"description": "Previous block info (base64-encoded)"
783783
},
784-
"last_commit_hash": {
785-
"type": "string",
786-
"format": "byte",
787-
"description": "Commit from aggregator(s) from the last block (base64-encoded)"
788-
},
789784
"data_hash": {
790785
"type": "string",
791786
"format": "byte",
792787
"description": "Block.Data root aka Transactions (base64-encoded)"
793788
},
794-
"consensus_hash": {
795-
"type": "string",
796-
"format": "byte",
797-
"description": "Consensus params for current block (base64-encoded)"
798-
},
799789
"app_hash": {
800790
"type": "string",
801791
"format": "byte",
802792
"description": "State after applying txs from the current block (base64-encoded)"
803793
},
804-
"last_results_hash": {
805-
"type": "string",
806-
"format": "byte",
807-
"description": "Root hash of all results from the txs from the previous block (base64-encoded)"
808-
},
809794
"proposer_address": {
810795
"type": "string",
811796
"format": "byte",
@@ -949,11 +934,6 @@
949934
"format": "int64",
950935
"description": "Data availability height"
951936
},
952-
"last_results_hash": {
953-
"type": "string",
954-
"format": "byte",
955-
"description": "Last results hash (base64-encoded)"
956-
},
957937
"app_hash": {
958938
"type": "string",
959939
"format": "byte",

0 commit comments

Comments
 (0)