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
4 changes: 4 additions & 0 deletions crates/astria-conductor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Update `idna` dependency to resolve cargo audit warning [#1869](https://github.com/astriaorg/astria/pull/1869).
- Remove panic source on shutdown [#1919](https://github.com/astriaorg/astria/pull/1919).

### Added

- Send `sequencer_block_hash` as part of `ExecuteBlockRequest` [#1999](https://github.com/astriaorg/astria/pull/1999).

## [1.0.0] - 2024-10-25

### Changed
Expand Down
2 changes: 2 additions & 0 deletions crates/astria-conductor/src/executor/client.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::time::Duration;

Check warning on line 1 in crates/astria-conductor/src/executor/client.rs

View workflow job for this annotation

GitHub Actions / Code Freeze

Code Freeze in Effect - Bypassed

This file is under code freeze.

use astria_core::{
execution::v1::{
Expand Down Expand Up @@ -119,6 +119,7 @@
prev_block_hash: Bytes,
transactions: Vec<Bytes>,
timestamp: Timestamp,
sequencer_block_hash: Bytes,
) -> eyre::Result<Block> {
use prost::Message;

Expand All @@ -132,6 +133,7 @@
prev_block_hash,
transactions,
timestamp: Some(timestamp),
sequencer_block_hash,
};
let response = tryhard::retry_fn(|| {
let mut client = self.inner.clone();
Expand Down
4 changes: 3 additions & 1 deletion crates/astria-conductor/src/executor/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{

Check warning on line 1 in crates/astria-conductor/src/executor/mod.rs

View workflow job for this annotation

GitHub Actions / Code Freeze

Code Freeze in Effect - Bypassed

This file is under code freeze.
collections::HashMap,
time::Duration,
};
Expand Down Expand Up @@ -496,16 +496,18 @@
block: ExecutableBlock,
) -> eyre::Result<Block> {
let ExecutableBlock {
hash,
transactions,
timestamp,
..
} = block;

let n_transactions = transactions.len();
let sequencer_block_hash = hash.as_bytes().to_vec().into();

let executed_block = self
.client
.execute_block_with_retry(parent_hash, transactions, timestamp)
.execute_block_with_retry(parent_hash, transactions, timestamp, sequencer_block_hash)
.await
.wrap_err("failed to run execute_block RPC")?;

Expand Down
2 changes: 2 additions & 0 deletions crates/astria-conductor/src/executor/state.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! After being created the state must be primed with [`State::init`] before any of

Check warning on line 1 in crates/astria-conductor/src/executor/state.rs

View workflow job for this annotation

GitHub Actions / Code Freeze

Code Freeze in Effect - Bypassed

This file is under code freeze.
//! the other methods can be used. Otherwise, they will panic.
//!
//! The inner state must not be unset after having been set.
Expand Down Expand Up @@ -347,6 +347,7 @@
seconds: 123_456,
nanos: 789,
}),
sequencer_block_hash: Bytes::new(),
})
.unwrap();
let soft = Block::try_from_raw(raw::Block {
Expand All @@ -357,6 +358,7 @@
seconds: 123_456,
nanos: 789,
}),
sequencer_block_hash: Bytes::new(),
})
.unwrap();
CommitmentState::builder()
Expand Down
1 change: 1 addition & 0 deletions crates/astria-conductor/src/executor/tests.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use astria_core::{

Check warning on line 1 in crates/astria-conductor/src/executor/tests.rs

View workflow job for this annotation

GitHub Actions / Code Freeze

Code Freeze in Effect - Bypassed

This file is under code freeze.
self,
execution::v1::{
Block,
Expand Down Expand Up @@ -32,6 +32,7 @@
seconds: 0,
nanos: 0,
}),
sequencer_block_hash: Bytes::new(),
}
}

Expand Down
1 change: 1 addition & 0 deletions crates/astria-conductor/tests/blackbox/helpers/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ macro_rules! block {
seconds: 1,
nanos: 1,
}),
sequencer_block_hash: ::bytes::Bytes::new(),
}
};
}
Expand Down
11 changes: 11 additions & 0 deletions crates/astria-core/src/execution/v1/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ pub struct Block {
parent_block_hash: Bytes,
/// Timestamp on the block, standardized to google protobuf standard.
timestamp: Timestamp,
/// The hash of the sequencer block that this block is derived from.
sequencer_block_hash: Bytes,
}

impl Block {
Expand All @@ -183,6 +185,11 @@ impl Block {
// effectively just a copy
self.timestamp.clone()
}

#[must_use]
pub fn sequencer_block_hash(&self) -> &Bytes {
&self.sequencer_block_hash
}
}

impl From<Block> for raw::Block {
Expand All @@ -201,6 +208,7 @@ impl Protobuf for Block {
hash,
parent_block_hash,
timestamp,
sequencer_block_hash,
} = raw;
// Cloning timestamp is effectively a copy because timestamp is just a (i32, i64) tuple
let timestamp = timestamp
Expand All @@ -212,6 +220,7 @@ impl Protobuf for Block {
hash: hash.clone(),
parent_block_hash: parent_block_hash.clone(),
timestamp,
sequencer_block_hash: sequencer_block_hash.clone(),
})
}

Expand All @@ -221,6 +230,7 @@ impl Protobuf for Block {
hash,
parent_block_hash,
timestamp,
sequencer_block_hash,
} = self;
Self::Raw {
number: *number,
Expand All @@ -229,6 +239,7 @@ impl Protobuf for Block {
// Cloning timestamp is effectively a copy because timestamp is just a (i32, i64)
// tuple
timestamp: Some(timestamp.clone()),
sequencer_block_hash: sequencer_block_hash.clone(),
}
}
}
Expand Down
12 changes: 12 additions & 0 deletions crates/astria-core/src/generated/astria.execution.v1.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 42 additions & 0 deletions crates/astria-core/src/generated/astria.execution.v1.serde.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions crates/astria-core/src/generated/astria.execution.v2.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading