Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions block/internal/executing/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ func (e *Executor) Stop() error {
func (e *Executor) GetLastState() types.State {
state := e.getLastState()
state.AppHash = bytes.Clone(state.AppHash)
state.LastResultsHash = bytes.Clone(state.LastResultsHash)

return state
}
Expand Down Expand Up @@ -512,7 +511,6 @@ func (e *Executor) createBlock(ctx context.Context, height uint64, batchData *Ba
Time: headerTime,
},
LastHeaderHash: lastHeaderHash,
ConsensusHash: make(types.Hash, 32),
AppHash: currentState.AppHash,
ProposerAddress: e.genesis.ProposerAddress,
ValidatorHash: validatorHash,
Expand Down
1 change: 0 additions & 1 deletion block/internal/executing/executor_restart_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ func TestExecutor_RestartUsesPendingHeader(t *testing.T) {
Time: uint64(time.Now().UnixNano()),
},
LastHeaderHash: originalHeader.Hash(),
ConsensusHash: make(types.Hash, 32),
AppHash: currentState.AppHash,
ProposerAddress: gen.ProposerAddress,
ValidatorHash: validatorHash,
Expand Down
1 change: 0 additions & 1 deletion block/internal/syncing/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ func (s *Syncer) GetLastState() types.State {

stateCopy := *state
stateCopy.AppHash = bytes.Clone(state.AppHash)
stateCopy.LastResultsHash = bytes.Clone(state.LastResultsHash)

return stateCopy
}
Expand Down
28 changes: 11 additions & 17 deletions client/crates/types/src/proto/evnode.v1.messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ pub struct GetPublicResponse {
#[prost(bytes = "vec", tag = "1")]
pub public_key: ::prost::alloc::vec::Vec<u8>,
}
/// 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.
/// 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.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Version {
Expand All @@ -52,23 +52,12 @@ pub struct Header {
/// Previous block info
#[prost(bytes = "vec", tag = "4")]
pub last_header_hash: ::prost::alloc::vec::Vec<u8>,
/// Commit from aggregator(s) from the last block
#[prost(bytes = "vec", tag = "5")]
pub last_commit_hash: ::prost::alloc::vec::Vec<u8>,
/// Block.Data root aka Transactions
#[prost(bytes = "vec", tag = "6")]
pub data_hash: ::prost::alloc::vec::Vec<u8>,
/// Consensus params for current block
#[prost(bytes = "vec", tag = "7")]
pub consensus_hash: ::prost::alloc::vec::Vec<u8>,
/// State after applying txs from the current block
#[prost(bytes = "vec", tag = "8")]
pub app_hash: ::prost::alloc::vec::Vec<u8>,
/// 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.
#[prost(bytes = "vec", tag = "9")]
pub last_results_hash: ::prost::alloc::vec::Vec<u8>,
/// 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.
Expand Down Expand Up @@ -178,8 +167,6 @@ pub struct State {
pub last_block_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(uint64, tag = "6")]
pub da_height: u64,
#[prost(bytes = "vec", tag = "7")]
pub last_results_hash: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "8")]
pub app_hash: ::prost::alloc::vec::Vec<u8>,
}
Expand Down Expand Up @@ -418,6 +405,13 @@ pub struct GetMetadataResponse {
#[prost(bytes = "vec", tag = "1")]
pub value: ::prost::alloc::vec::Vec<u8>,
}
/// GetGenesisDaHeightResponse defines the DA height at which the first Evolve block was included.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetGenesisDaHeightResponse {
#[prost(uint64, tag = "3")]
pub height: u64,
}
/// GetNamespaceResponse returns the namespace for this network
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
Expand Down
108 changes: 89 additions & 19 deletions client/crates/types/src/proto/evnode.v1.services.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,10 +394,10 @@ pub mod signer_service_server {
const NAME: &'static str = "evnode.v1.SignerService";
}
}
/// 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.
/// 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.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Version {
Expand All @@ -422,23 +422,12 @@ pub struct Header {
/// Previous block info
#[prost(bytes = "vec", tag = "4")]
pub last_header_hash: ::prost::alloc::vec::Vec<u8>,
/// Commit from aggregator(s) from the last block
#[prost(bytes = "vec", tag = "5")]
pub last_commit_hash: ::prost::alloc::vec::Vec<u8>,
/// Block.Data root aka Transactions
#[prost(bytes = "vec", tag = "6")]
pub data_hash: ::prost::alloc::vec::Vec<u8>,
/// Consensus params for current block
#[prost(bytes = "vec", tag = "7")]
pub consensus_hash: ::prost::alloc::vec::Vec<u8>,
/// State after applying txs from the current block
#[prost(bytes = "vec", tag = "8")]
pub app_hash: ::prost::alloc::vec::Vec<u8>,
/// 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.
#[prost(bytes = "vec", tag = "9")]
pub last_results_hash: ::prost::alloc::vec::Vec<u8>,
/// 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.
Expand Down Expand Up @@ -548,8 +537,6 @@ pub struct State {
pub last_block_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(uint64, tag = "6")]
pub da_height: u64,
#[prost(bytes = "vec", tag = "7")]
pub last_results_hash: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "8")]
pub app_hash: ::prost::alloc::vec::Vec<u8>,
}
Expand Down Expand Up @@ -1978,6 +1965,13 @@ pub struct GetMetadataResponse {
#[prost(bytes = "vec", tag = "1")]
pub value: ::prost::alloc::vec::Vec<u8>,
}
/// GetGenesisDaHeightResponse defines the DA height at which the first Evolve block was included.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetGenesisDaHeightResponse {
#[prost(uint64, tag = "3")]
pub height: u64,
}
/// Generated client implementations.
pub mod store_service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
Expand Down Expand Up @@ -2142,6 +2136,32 @@ pub mod store_service_client {
.insert(GrpcMethod::new("evnode.v1.StoreService", "GetMetadata"));
self.inner.unary(req, path, codec).await
}
/// GetGenesisDaHeight returns the DA height at which the first Evolve block was included.
pub async fn get_genesis_da_height(
&mut self,
request: impl tonic::IntoRequest<()>,
) -> std::result::Result<
tonic::Response<super::GetGenesisDaHeightResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/evnode.v1.StoreService/GetGenesisDaHeight",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("evnode.v1.StoreService", "GetGenesisDaHeight"));
self.inner.unary(req, path, codec).await
}
}
}
/// Generated server implementations.
Expand Down Expand Up @@ -2175,6 +2195,14 @@ pub mod store_service_server {
tonic::Response<super::GetMetadataResponse>,
tonic::Status,
>;
/// GetGenesisDaHeight returns the DA height at which the first Evolve block was included.
async fn get_genesis_da_height(
&self,
request: tonic::Request<()>,
) -> std::result::Result<
tonic::Response<super::GetGenesisDaHeightResponse>,
tonic::Status,
>;
}
/// StoreService defines the RPC service for the store package
#[derive(Debug)]
Expand Down Expand Up @@ -2389,6 +2417,48 @@ pub mod store_service_server {
};
Box::pin(fut)
}
"/evnode.v1.StoreService/GetGenesisDaHeight" => {
#[allow(non_camel_case_types)]
struct GetGenesisDaHeightSvc<T: StoreService>(pub Arc<T>);
impl<T: StoreService> tonic::server::UnaryService<()>
for GetGenesisDaHeightSvc<T> {
type Response = super::GetGenesisDaHeightResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(&mut self, request: tonic::Request<()>) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as StoreService>::get_genesis_da_height(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = GetGenesisDaHeightSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
Ok(
Expand Down Expand Up @@ -2558,7 +2628,7 @@ pub mod config_service_client {
.insert(GrpcMethod::new("evnode.v1.ConfigService", "GetNamespace"));
self.inner.unary(req, path, codec).await
}
/// GetSequencerInfo returns information about the sequencer
/// GetSignerInfo returns information about the signer
pub async fn get_signer_info(
&mut self,
request: impl tonic::IntoRequest<()>,
Expand Down Expand Up @@ -2601,7 +2671,7 @@ pub mod config_service_server {
tonic::Response<super::GetNamespaceResponse>,
tonic::Status,
>;
/// GetSequencerInfo returns information about the sequencer
/// GetSignerInfo returns information about the signer
async fn get_signer_info(
&self,
request: tonic::Request<()>,
Expand Down
6 changes: 0 additions & 6 deletions docs/adr/adr-004-core-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,9 @@ type Header struct {
LastHeaderHash [32]byte

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

// 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.
LastResultsHash [32]byte


// Note that the address can be derived from the pubkey which can be derived
// from the signature when using secp256k.
Expand Down
12 changes: 0 additions & 12 deletions docs/adr/adr-015-rollkit-minimal-header.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,10 @@ This minimal Rollkit header can be transformed to be tailored to a specific exec
This header can be transformed into an ABCI-specific header for IBC compatibility.

- `Version`: Required by IBC clients to correctly interpret the block's structure and contents.
- `LastCommitHash`: The hash of the previous block's commit, used by IBC clients to verify the legitimacy of the block's state transitions.
- `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.
- `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.
- `NextValidatorsHash`: The hash of the next validator set, allowing IBC clients to anticipate and verify upcoming validators.
- `ConsensusHash`: Denotes the hash of the consensus parameters, ensuring that IBC clients are aligned with the consensus rules of the blockchain.
- `AppHash`: Same as the `StateRoot` in the Rollkit Header.
- `EvidenceHash`: A hash of evidence of any misbehavior by validators, which IBC clients use to assess the trustworthiness of the validator set.
- `LastResultsHash`: Root hash of all results from the transactions from the previous block.
- `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.

#### Transformation to ABCI Header
Expand All @@ -139,18 +135,10 @@ This header can be transformed into an ABCI-specific header for IBC compatibilit
├─────────────────────┼───────────────────────┤
│ Version │ Added for IBC │
├─────────────────────┼───────────────────────┤
│ LastCommitHash │ Added for IBC │
├─────────────────────┼───────────────────────┤
│ ValidatorHash │ Added for IBC │
├─────────────────────┼───────────────────────┤
│ NextValidatorsHash │ Added for IBC │
├─────────────────────┼───────────────────────┤
│ ConsensusHash │ Added for IBC │
├─────────────────────┼───────────────────────┤
│ EvidenceHash │ Added for IBC │
├─────────────────────┼───────────────────────┤
│ LastResultsHash │ Added for IBC │
├─────────────────────┼───────────────────────┤
│ ProposerAddress │ From ExtraData │
└─────────────────────┴───────────────────────┘
```
Expand Down
5 changes: 0 additions & 5 deletions docs/learn/specs/block-validity.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ SignedHeader.Verify(untrustedHeader *SignedHeader)
return error "headers are not adjacent"
// Verify the link to previous header
verify untrustedHeader.LastHeaderHash == h.Header.Hash()
// Verify LastCommit hash matches previous signature
verify untrustedHeader.LastCommitHash == sh.Signature.GetCommitHash(...)
// Note: ValidatorHash field exists for compatibility but is not validated
```

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

Expand Down
20 changes: 0 additions & 20 deletions docs/src/openapi-rpc.json
Original file line number Diff line number Diff line change
Expand Up @@ -781,31 +781,16 @@
"format": "byte",
"description": "Previous block info (base64-encoded)"
},
"last_commit_hash": {
"type": "string",
"format": "byte",
"description": "Commit from aggregator(s) from the last block (base64-encoded)"
},
"data_hash": {
"type": "string",
"format": "byte",
"description": "Block.Data root aka Transactions (base64-encoded)"
},
"consensus_hash": {
"type": "string",
"format": "byte",
"description": "Consensus params for current block (base64-encoded)"
},
"app_hash": {
"type": "string",
"format": "byte",
"description": "State after applying txs from the current block (base64-encoded)"
},
"last_results_hash": {
"type": "string",
"format": "byte",
"description": "Root hash of all results from the txs from the previous block (base64-encoded)"
},
"proposer_address": {
"type": "string",
"format": "byte",
Expand Down Expand Up @@ -949,11 +934,6 @@
"format": "int64",
"description": "Data availability height"
},
"last_results_hash": {
"type": "string",
"format": "byte",
"description": "Last results hash (base64-encoded)"
},
"app_hash": {
"type": "string",
"format": "byte",
Expand Down
Loading
Loading