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: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@v7

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deny.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@v7

- name: Run cargo-deny
uses: EmbarkStudios/cargo-deny-action@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@v7

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/label-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
issues: write
pull-requests: write
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v7
with:
fetch-depth: 0

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@v7

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
Expand All @@ -37,7 +37,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@v7

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
Expand All @@ -63,7 +63,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@v7

- name: Check spelling
uses: crate-ci/typos@v1
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
needs: extract-version
steps:
- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@v7
with:
ref: ${{ needs.extract-version.outputs.ref }}
persist-credentials: false
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
archive: morph-reth-${{ needs.extract-version.outputs.version }}-aarch64-linux
steps:
- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@v7
with:
ref: ${{ needs.extract-version.outputs.ref }}
persist-credentials: false
Expand Down Expand Up @@ -161,7 +161,7 @@ jobs:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@v7
with:
ref: ${{ needs.extract-version.outputs.ref }}
fetch-depth: 0
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@v7

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
Expand All @@ -50,7 +50,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@v7

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
Expand All @@ -72,7 +72,7 @@ jobs:
timeout-minutes: 15
steps:
- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@v7

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
Expand Down
30 changes: 15 additions & 15 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace.package]
version = "0.3.0"
version = "1.0.0"
edition = "2024"
rust-version = "1.93"
license = "MIT OR Apache-2.0"
Expand Down
14 changes: 14 additions & 0 deletions Cross.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,16 @@
[build.env]
passthrough = ["JEMALLOC_SYS_WITH_LG_PAGE"]

# The default x86_64-unknown-linux-gnu cross image (Ubuntu 20.04) ships GCC 9.x,
# which is affected by https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95189 (a memcmp
# miscompilation). aws-lc-sys >= 0.33 hard-panics with "### COMPILER BUG DETECTED ###"
# when it finds this compiler, breaking the build. Install GCC 10 (10.3.0, in the
# "known to work" set) and point gcc/g++/cc at it so every C dependency builds with it.
# aarch64 is unaffected: it's a true cross-compile, so aws-lc-sys can't run its probe
# binary and skips the check entirely.
[target.x86_64-unknown-linux-gnu]
pre-build = [
"apt-get update && apt-get install --assume-yes gcc-10 g++-10",
"update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10",
"update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-10 100",
]
16 changes: 16 additions & 0 deletions crates/consensus/src/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,10 @@ impl Consensus<Block> for MorphConsensus {

Ok(())
}

fn is_transient_error(&self, error: &ConsensusError) -> bool {
matches!(error, ConsensusError::TimestampIsInFuture { .. })
}
}

// ============================================================================
Expand Down Expand Up @@ -1131,6 +1135,18 @@ mod tests {
));
}

#[test]
fn test_timestamp_in_future_is_transient_error() {
let chain_spec = create_test_chainspec();
let consensus = MorphConsensus::new(chain_spec);
let error = ConsensusError::TimestampIsInFuture {
timestamp: 2,
present_timestamp: 1,
};

assert!(Consensus::<Block>::is_transient_error(&consensus, &error));
}

#[test]
fn test_validate_header_gas_limit_exceeds_max() {
let chain_spec = create_test_chainspec();
Expand Down
29 changes: 14 additions & 15 deletions crates/engine-api/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use reth_payload_builder::{BuildNewPayload, PayloadBuilderHandle};
#[cfg(test)]
use reth_primitives_traits::RecoveredBlock;
use reth_primitives_traits::{FastInstant as Instant, SealedBlock, SealedHeader};
use reth_provider::{BlockNumReader, CanonChainTracker, HeaderProvider};
use reth_provider::{BlockNumReader, BlockReaderIdExt, CanonChainTracker, HeaderProvider};
use std::sync::Arc;

// =============================================================================
Expand Down Expand Up @@ -140,6 +140,7 @@ impl<Provider> MorphL2EngineApi for RealMorphL2EngineApi<Provider>
where
Provider: HeaderProvider<Header = MorphHeader>
+ BlockNumReader
+ BlockReaderIdExt<Header = MorphHeader>
+ CanonChainTracker<Header = MorphHeader>
+ Clone
+ Send
Expand Down Expand Up @@ -644,8 +645,13 @@ impl<Provider> RealMorphL2EngineApi<Provider> {
parent_override: Option<B256>,
) -> EngineApiResult<MorphBuiltPayload>
where
Provider:
HeaderProvider<Header = MorphHeader> + BlockNumReader + Clone + Send + Sync + 'static,
Provider: HeaderProvider<Header = MorphHeader>
+ BlockNumReader
+ BlockReaderIdExt<Header = MorphHeader>
+ Clone
+ Send
+ Sync
+ 'static,
{
tracing::debug!(
target: "morph::engine",
Expand Down Expand Up @@ -926,26 +932,19 @@ impl<Provider> RealMorphL2EngineApi<Provider> {

fn current_head(&self) -> EngineApiResult<CanonicalHead>
where
Provider: HeaderProvider + BlockNumReader,
Provider: BlockReaderIdExt<Header = MorphHeader>,
{
let info = self
.provider
.chain_info()
.map_err(|e| MorphEngineApiError::Database(e.to_string()))?;
let header = self
.provider
.sealed_header_by_hash(info.best_hash)
.latest_header()
.map_err(|e| MorphEngineApiError::Database(e.to_string()))?
.ok_or_else(|| {
MorphEngineApiError::Internal(format!(
"canonical head header {} ({}) not found",
info.best_number, info.best_hash
))
MorphEngineApiError::Internal("canonical head header not found".to_string())
})?;

Ok(CanonicalHead {
number: info.best_number,
hash: info.best_hash,
number: header.number(),
hash: header.hash(),
timestamp: header.timestamp(),
})
}
Expand Down
Loading
Loading