From a0e2e06cc17f49f9768d93b754951464326d61c4 Mon Sep 17 00:00:00 2001 From: Pravdyvy <46261001+Pravdyvy@users.noreply.github.com> Date: Mon, 23 Feb 2026 14:47:23 +0200 Subject: [PATCH 1/2] Apply suggestions from code review Co-authored-by: Daniil Polyakov --- common/src/block.rs | 2 +- common/src/transaction.rs | 2 +- indexer/service/docker-entrypoint.sh | 8 ++++---- indexer/service/src/service.rs | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/common/src/block.rs b/common/src/block.rs index 108b0072..0343435b 100644 --- a/common/src/block.rs +++ b/common/src/block.rs @@ -52,7 +52,7 @@ pub enum BedrockStatus { Finalized, } -#[derive(Debug, BorshSerialize, BorshDeserialize, Clone)] +#[derive(Debug, Clone, BorshSerialize, BorshDeserialize)] pub struct Block { pub header: BlockHeader, pub body: BlockBody, diff --git a/common/src/transaction.rs b/common/src/transaction.rs index 3b0d0c5f..33617da7 100644 --- a/common/src/transaction.rs +++ b/common/src/transaction.rs @@ -99,7 +99,7 @@ pub enum TxKind { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, thiserror::Error)] pub enum TransactionMalformationError { - #[error("Invalid signature(s)")] + #[error("Invalid signature(-s)")] InvalidSignature, #[error("Failed to decode transaction with hash: {tx:?}")] FailedToDecode { tx: HashType }, diff --git a/indexer/service/docker-entrypoint.sh b/indexer/service/docker-entrypoint.sh index fb117131..d9408a05 100644 --- a/indexer/service/docker-entrypoint.sh +++ b/indexer/service/docker-entrypoint.sh @@ -1,11 +1,11 @@ #!/bin/sh -# This is an entrypoint script for the sequencer_runner Docker container, +# This is an entrypoint script for the indexer_service Docker container, # it's not meant to be executed outside of the container. set -e -CONFIG="/etc/sequencer_runner/sequencer_config.json" +CONFIG="/etc/indexer_service/indexer_service.json" # Check config file exists if [ ! -f "$CONFIG" ]; then @@ -24,6 +24,6 @@ fi # Give permissions to the data directory and switch to non-root user if [ "$(id -u)" = "0" ]; then mkdir -p "$HOME_DIR" - chown -R sequencer_user:sequencer_user "$HOME_DIR" - exec gosu sequencer_user "$@" + chown -R indexer_service_user:indexer_service_user "$HOME_DIR" + exec gosu indexer_service_user "$@" fi diff --git a/indexer/service/src/service.rs b/indexer/service/src/service.rs index fb78e4cf..6f33eef1 100644 --- a/indexer/service/src/service.rs +++ b/indexer/service/src/service.rs @@ -278,5 +278,5 @@ pub fn not_yet_implemented_error() -> ErrorObjectOwned { } fn db_error(err: anyhow::Error) -> ErrorObjectOwned { - ErrorObjectOwned::owned(-32001, "DBError".to_string(), Some(format!("{err:#?}"))) + ErrorObjectOwned::owned(ErrorCode::InternalError.code(), "DBError".to_string(), Some(format!("{err:#?}"))) } From 6101d791e3242fa695cb90e0729db70c95f2eaca Mon Sep 17 00:00:00 2001 From: Pravdyvy Date: Mon, 23 Feb 2026 16:10:56 +0200 Subject: [PATCH 2/2] fix: suggestions fix --- indexer/service/Dockerfile | 5 +++++ indexer/service/src/service.rs | 6 +++++- sequencer_core/src/block_settlement_client.rs | 3 ++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/indexer/service/Dockerfile b/indexer/service/Dockerfile index 4dadc1cf..081e8b06 100644 --- a/indexer/service/Dockerfile +++ b/indexer/service/Dockerfile @@ -35,6 +35,11 @@ RUN strip /indexer_service/target/release/indexer_service # Runtime stage - minimal image FROM debian:trixie-slim +# Install runtime dependencies +RUN apt-get update \ + && apt-get install -y gosu jq \ + && rm -rf /var/lib/apt/lists/* + # Create non-root user for security RUN useradd -m -u 1000 -s /bin/bash indexer_service_user && \ mkdir -p /indexer_service /etc/indexer_service && \ diff --git a/indexer/service/src/service.rs b/indexer/service/src/service.rs index 6f33eef1..13ec2ea8 100644 --- a/indexer/service/src/service.rs +++ b/indexer/service/src/service.rs @@ -278,5 +278,9 @@ pub fn not_yet_implemented_error() -> ErrorObjectOwned { } fn db_error(err: anyhow::Error) -> ErrorObjectOwned { - ErrorObjectOwned::owned(ErrorCode::InternalError.code(), "DBError".to_string(), Some(format!("{err:#?}"))) + ErrorObjectOwned::owned( + ErrorCode::InternalError.code(), + "DBError".to_string(), + Some(format!("{err:#?}")), + ) } diff --git a/sequencer_core/src/block_settlement_client.rs b/sequencer_core/src/block_settlement_client.rs index a9b84525..075ebd11 100644 --- a/sequencer_core/src/block_settlement_client.rs +++ b/sequencer_core/src/block_settlement_client.rs @@ -99,12 +99,13 @@ impl BlockSettlementClientTrait for BlockSettlementClient { Some(Op::ChannelInscribe(inscribe)) => (inscribe.parent, inscribe.id()), _ => panic!("Expected ChannelInscribe op"), }; - log::info!("Posted block to Bedrock with parent id {parent_id:?} and msg id: {msg_id:?}"); self.bedrock_client .post_transaction(tx) .await .context("Failed to post transaction to Bedrock")?; + log::info!("Posted block to Bedrock with parent id {parent_id:?} and msg id: {msg_id:?}"); + Ok(()) }