Skip to content

Commit 8b0f5c9

Browse files
authored
Merge branch 'main' into julien/signature-payload
2 parents 521bdad + 2fcecc6 commit 8b0f5c9

25 files changed

Lines changed: 249 additions & 38 deletions

File tree

block/manager.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,11 @@ func (m *Manager) GetExecutor() coreexecutor.Executor {
576576
return m.exec
577577
}
578578

579+
// GetSigner returns the signer instance used by this manager
580+
func (m *Manager) GetSigner() (address []byte) {
581+
return m.genesis.ProposerAddress
582+
}
583+
579584
func (m *Manager) retrieveBatch(ctx context.Context) (*BatchData, error) {
580585
m.logger.Debug().Str("chainID", m.genesis.ChainID).Interface("lastBatchData", m.lastBatchData).Msg("Attempting to retrieve next batch")
581586

client/crates/client/src/config.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
use crate::{client::Client, error::Result};
2-
use ev_types::v1::{config_service_client::ConfigServiceClient, GetNamespaceResponse};
2+
use ev_types::v1::{
3+
config_service_client::ConfigServiceClient, GetNamespaceResponse, GetSignerInfoResponse,
4+
};
35
use tonic::Request;
46

57
pub struct ConfigClient {
@@ -21,6 +23,14 @@ impl ConfigClient {
2123
Ok(response.into_inner())
2224
}
2325

26+
/// Get SequencerInfo
27+
pub async fn get_signer_info(&self) -> Result<GetSignerInfoResponse> {
28+
let request = Request::new(());
29+
let response = self.inner.clone().get_signer_info(request).await?;
30+
31+
Ok(response.into_inner())
32+
}
33+
2434
/// Get the header namespace
2535
pub async fn get_header_namespace(&self) -> Result<String> {
2636
let response = self.get_namespace().await?;

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,3 +427,10 @@ pub struct GetNamespaceResponse {
427427
#[prost(string, tag = "2")]
428428
pub data_namespace: ::prost::alloc::string::String,
429429
}
430+
/// GetSequencerInfoResponse returns information about the sequencer
431+
#[allow(clippy::derive_partial_eq_without_eq)]
432+
#[derive(Clone, PartialEq, ::prost::Message)]
433+
pub struct GetSignerInfoResponse {
434+
#[prost(bytes = "vec", tag = "1")]
435+
pub address: ::prost::alloc::vec::Vec<u8>,
436+
}

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

Lines changed: 84 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2439,12 +2439,19 @@ pub struct GetNamespaceResponse {
24392439
#[prost(string, tag = "2")]
24402440
pub data_namespace: ::prost::alloc::string::String,
24412441
}
2442+
/// GetSequencerInfoResponse returns information about the sequencer
2443+
#[allow(clippy::derive_partial_eq_without_eq)]
2444+
#[derive(Clone, PartialEq, ::prost::Message)]
2445+
pub struct GetSignerInfoResponse {
2446+
#[prost(bytes = "vec", tag = "1")]
2447+
pub address: ::prost::alloc::vec::Vec<u8>,
2448+
}
24422449
/// Generated client implementations.
24432450
pub mod config_service_client {
24442451
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
24452452
use tonic::codegen::*;
24462453
use tonic::codegen::http::Uri;
2447-
/// StoreService defines the RPC service for the store package
2454+
/// ConfigService defines the RPC service for configuration queries
24482455
#[derive(Debug, Clone)]
24492456
pub struct ConfigServiceClient<T> {
24502457
inner: tonic::client::Grpc<T>,
@@ -2551,6 +2558,32 @@ pub mod config_service_client {
25512558
.insert(GrpcMethod::new("evnode.v1.ConfigService", "GetNamespace"));
25522559
self.inner.unary(req, path, codec).await
25532560
}
2561+
/// GetSequencerInfo returns information about the sequencer
2562+
pub async fn get_signer_info(
2563+
&mut self,
2564+
request: impl tonic::IntoRequest<()>,
2565+
) -> std::result::Result<
2566+
tonic::Response<super::GetSignerInfoResponse>,
2567+
tonic::Status,
2568+
> {
2569+
self.inner
2570+
.ready()
2571+
.await
2572+
.map_err(|e| {
2573+
tonic::Status::new(
2574+
tonic::Code::Unknown,
2575+
format!("Service was not ready: {}", e.into()),
2576+
)
2577+
})?;
2578+
let codec = tonic::codec::ProstCodec::default();
2579+
let path = http::uri::PathAndQuery::from_static(
2580+
"/evnode.v1.ConfigService/GetSignerInfo",
2581+
);
2582+
let mut req = request.into_request();
2583+
req.extensions_mut()
2584+
.insert(GrpcMethod::new("evnode.v1.ConfigService", "GetSignerInfo"));
2585+
self.inner.unary(req, path, codec).await
2586+
}
25542587
}
25552588
}
25562589
/// Generated server implementations.
@@ -2568,8 +2601,16 @@ pub mod config_service_server {
25682601
tonic::Response<super::GetNamespaceResponse>,
25692602
tonic::Status,
25702603
>;
2604+
/// GetSequencerInfo returns information about the sequencer
2605+
async fn get_signer_info(
2606+
&self,
2607+
request: tonic::Request<()>,
2608+
) -> std::result::Result<
2609+
tonic::Response<super::GetSignerInfoResponse>,
2610+
tonic::Status,
2611+
>;
25712612
}
2572-
/// StoreService defines the RPC service for the store package
2613+
/// ConfigService defines the RPC service for configuration queries
25732614
#[derive(Debug)]
25742615
pub struct ConfigServiceServer<T: ConfigService> {
25752616
inner: _Inner<T>,
@@ -2690,6 +2731,47 @@ pub mod config_service_server {
26902731
};
26912732
Box::pin(fut)
26922733
}
2734+
"/evnode.v1.ConfigService/GetSignerInfo" => {
2735+
#[allow(non_camel_case_types)]
2736+
struct GetSignerInfoSvc<T: ConfigService>(pub Arc<T>);
2737+
impl<T: ConfigService> tonic::server::UnaryService<()>
2738+
for GetSignerInfoSvc<T> {
2739+
type Response = super::GetSignerInfoResponse;
2740+
type Future = BoxFuture<
2741+
tonic::Response<Self::Response>,
2742+
tonic::Status,
2743+
>;
2744+
fn call(&mut self, request: tonic::Request<()>) -> Self::Future {
2745+
let inner = Arc::clone(&self.0);
2746+
let fut = async move {
2747+
<T as ConfigService>::get_signer_info(&inner, request).await
2748+
};
2749+
Box::pin(fut)
2750+
}
2751+
}
2752+
let accept_compression_encodings = self.accept_compression_encodings;
2753+
let send_compression_encodings = self.send_compression_encodings;
2754+
let max_decoding_message_size = self.max_decoding_message_size;
2755+
let max_encoding_message_size = self.max_encoding_message_size;
2756+
let inner = self.inner.clone();
2757+
let fut = async move {
2758+
let inner = inner.0;
2759+
let method = GetSignerInfoSvc(inner);
2760+
let codec = tonic::codec::ProstCodec::default();
2761+
let mut grpc = tonic::server::Grpc::new(codec)
2762+
.apply_compression_config(
2763+
accept_compression_encodings,
2764+
send_compression_encodings,
2765+
)
2766+
.apply_max_message_size_config(
2767+
max_decoding_message_size,
2768+
max_encoding_message_size,
2769+
);
2770+
let res = grpc.unary(method, req).await;
2771+
Ok(res)
2772+
};
2773+
Box::pin(fut)
2774+
}
26932775
_ => {
26942776
Box::pin(async move {
26952777
Ok(

docs/guides/create-genesis.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,4 @@ gmd start --evnode.node.aggregator
118118

119119
## Summary
120120

121-
By following these steps, you will set up the genesis for your chain, initialize the validator, add a genesis account, and started the chain. This guide provides a basic framework for configuring and starting your chain using the gm-world binary. Make sure you initialized your chain correctly, and use the `gmd` command for all operations.
121+
By following these steps, you will set up the genesis for your chain, initialize the validator, add a genesis account, and start the chain. This guide provides a basic framework for configuring and starting your chain using the gm-world binary. Make sure you initialized your chain correctly, and use the `gmd` command for all operations.

docs/guides/gm-world.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,4 +291,4 @@ If you run into any issues, make sure your Keplr wallet is updated and set to co
291291

292292
## 🎉 Next steps
293293

294-
Congratulations! You've experienced connecting to a chain from the user side — simple and straightforward. Now, you might consider exploring how to add more application logic to your chain using the Cosmos SDK, as demonstrated in our Wordle App tutorial.
294+
Congratulations! You've experienced connecting to a chain from the user side — simple and straightforward. Now, you might consider exploring how to add more application logic to your chain using the Cosmos SDK, as demonstrated in our World App tutorial.

docs/learn/specs/block-manager.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ flowchart TD
374374
- Sends to sync goroutine for state update
375375
- Successful processing triggers immediate next retrieval without waiting for timer
376376
- Updates namespace migration status when appropriate:
377-
- Marks migration complete when data found in new namespaces
377+
- Marks migration complete when data is found in new namespaces
378378
- Persists migration state to avoid future legacy checks
379379

380380
#### Header and Data Caching

node/full.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ func (n *FullNode) Run(parentCtx context.Context) error {
328328
}
329329

330330
// Start RPC server
331-
handler, err := rpcserver.NewServiceHandler(n.Store, n.p2pClient, n.Logger, n.nodeConfig)
331+
handler, err := rpcserver.NewServiceHandler(n.Store, n.p2pClient, n.blockManager.GetSigner(), n.Logger, n.nodeConfig)
332332
if err != nil {
333333
return fmt.Errorf("error creating RPC handler: %w", err)
334334
}

node/light.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ func (ln *LightNode) Run(parentCtx context.Context) error {
7676
}()
7777

7878
ln.running = true
79-
// Start RPC server
80-
handler, err := rpcserver.NewServiceHandler(ln.Store, ln.P2P, ln.Logger, ln.nodeConfig)
79+
// Start RPC server (light node doesn't have a signer)
80+
handler, err := rpcserver.NewServiceHandler(ln.Store, ln.P2P, nil, ln.Logger, ln.nodeConfig)
8181
if err != nil {
8282
return fmt.Errorf("error creating RPC handler: %w", err)
8383
}

pkg/rpc/client/client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func setupTestServer(t *testing.T, mockStore *mocks.MockStore, mockP2P *mocks.Mo
3737
// Create config server with test config
3838
testConfig := config.DefaultConfig
3939
testConfig.DA.Namespace = "test-headers"
40-
configServer := server.NewConfigServer(testConfig, logger)
40+
configServer := server.NewConfigServer(testConfig, nil, logger)
4141

4242
// Register the store service
4343
storePath, storeHandler := rpc.NewStoreServiceHandler(storeServer)

0 commit comments

Comments
 (0)