Skip to content

Commit

Permalink
feat: update genesis blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
johntaiko committed Jan 2, 2025
1 parent 401c0e3 commit b2b1066
Show file tree
Hide file tree
Showing 4 changed files with 390 additions and 396 deletions.
20 changes: 9 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ EF_TESTS_DIR := ./testing/ef-tests/ethereum-tests

# The docker image name
DOCKER_IMAGE_NAME ?= ghcr.io/paradigmxyz/reth
TAIKO_DOCKER_IMAGE_NAME ?= us-docker.pkg.dev/evmchain/images/taiko-reth

# Features in reth/op-reth binary crate other than "ethereum" and "optimism"
BIN_OTHER_FEATURES := asm-keccak jemalloc jemalloc-prof min-error-logs min-warn-logs min-info-logs min-debug-logs min-trace-logs
Expand Down Expand Up @@ -385,16 +386,13 @@ define taiko_docker_build_push

docker buildx build --file ./DockerfileTaiko.cross . \
--platform linux/amd64,linux/arm64 \
--tag $(DOCKER_IMAGE_NAME):$(1) \
--tag $(DOCKER_IMAGE_NAME):$(2) \
--tag $(TAIKO_DOCKER_IMAGE_NAME):$(1) \
--tag $(TAIKO_DOCKER_IMAGE_NAME):$(2) \
--provenance=false \
--push
endef

# Note: This requires a buildx builder with emulation support. For example:
#
# `docker run --privileged --rm tonistiigi/binfmt --install amd64,arm64`
# `docker buildx create --use --driver docker-container --name cross-builder`
# Note: Build docker image for testing
.PHONY: taiko-docker-build-latest
taiko-docker-build-latest: ## Build and push a cross-arch Docker image tagged with the latest git tag and `latest`.
$(call taiko_docker_build,$(GIT_TAG),latest)
Expand All @@ -405,14 +403,14 @@ define taiko_docker_build
mkdir -p $(BIN_DIR)/amd64
cp $(CARGO_TARGET_DIR)/x86_64-unknown-linux-gnu/$(PROFILE)/taiko-reth $(BIN_DIR)/amd64/taiko-reth

$(MAKE) taiko-build-aarch64-unknown-linux-gnu
mkdir -p $(BIN_DIR)/arm64
cp $(CARGO_TARGET_DIR)/aarch64-unknown-linux-gnu/$(PROFILE)/taiko-reth $(BIN_DIR)/arm64/taiko-reth
# $(MAKE) taiko-build-aarch64-unknown-linux-gnu
# mkdir -p $(BIN_DIR)/arm64
# cp $(CARGO_TARGET_DIR)/aarch64-unknown-linux-gnu/$(PROFILE)/taiko-reth $(BIN_DIR)/arm64/taiko-reth

docker buildx build --file ./DockerfileTaiko.cross . \
--platform linux/amd64,linux/arm64 \
--tag $(DOCKER_IMAGE_NAME):$(1) \
--tag $(DOCKER_IMAGE_NAME):$(2) \
--tag $(TAIKO_DOCKER_IMAGE_NAME):$(1) \
--tag $(TAIKO_DOCKER_IMAGE_NAME):$(2) \
--provenance=false
endef

Expand Down
736 changes: 368 additions & 368 deletions crates/taiko/chainspec/res/genesis/internal_l2a.json

Large diffs are not rendered by default.

11 changes: 4 additions & 7 deletions crates/taiko/chainspec/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ impl From<Genesis> for TaikoChainSpec {
CHAIN_INTERNAL_TESTNET => Some(INTERNAL_DEVNET_ONTAKE_BLOCK),
CHAIN_HEKLA_TESTNET => Some(HEKLA_ONTAKE_BLOCK),
CHAIN_MAINNET => Some(MAINNET_ONTAKE_BLOCK),
_ => None,
_ => unreachable!(),
};

// Block-based hardforks
Expand Down Expand Up @@ -411,12 +411,9 @@ mod tests {
println!("Genesis: {_alloc:?}");
};

for chain in [
CHAIN_MAINNET,
CHAIN_INTERNAL_TESTNET,
CHAIN_KATLA_TESTNET,
CHAIN_HEKLA_TESTNET,
] {
for chain in
[CHAIN_MAINNET, CHAIN_INTERNAL_TESTNET, CHAIN_KATLA_TESTNET, CHAIN_HEKLA_TESTNET]
{
load_genesis(chain);
}
}
Expand Down
19 changes: 9 additions & 10 deletions crates/taiko/rpc/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,26 @@ use reth_evm::{
ConfigureEvmEnv,
};
use reth_node_api::NodePrimitives;
use reth_primitives::{InvalidTransactionError, SealedBlockWithSenders};
use reth_primitives::SealedBlockWithSenders;
use reth_provider::{
BlockExecutionOutput, BlockIdReader, BlockNumReader, BlockReader, HeaderProvider,
L1OriginReader, ProviderBlock, ProviderHeader, StateProofProvider, StateProviderFactory,
};
use reth_revm::database::StateProviderDatabase;
use reth_rpc_eth_api::{
helpers::TraceExt, EthApiTypes, FromEthApiError as _, FromEvmError as _, RpcNodeCore,
};
use reth_rpc_eth_api::{helpers::TraceExt, EthApiTypes, FromEthApiError as _, RpcNodeCore};
use reth_rpc_eth_types::EthApiError;
use reth_rpc_server_types::ToRpcResult;
use reth_rpc_types_compat::{block::from_block, transaction::from_recovered};
use reth_taiko_evm::encode_and_compress_tx_list;
use reth_taiko_primitives::L1Origin;
use reth_tasks::pool::BlockingTaskGuard;
use reth_transaction_pool::{
error::InvalidPoolTransactionError, pool::BestTransactionsWithPrioritizedSenders,
BestTransactions, BestTransactionsAttributes, TransactionPool,
pool::BestTransactionsWithPrioritizedSenders, BestTransactions, BestTransactionsAttributes,
TransactionPool,
};
use revm::{
db::{BundleState, CacheDB, State},
primitives::{EVMError, Env, InvalidTransaction, ResultAndState},
primitives::{Env, ResultAndState},
DatabaseCommit,
};
use serde::{Deserialize, Serialize};
Expand Down Expand Up @@ -393,7 +391,8 @@ where
base_fee, None,
))
.filter_transactions(|tx| {
tx.effective_tip_per_gas(base_fee).is_some_and(|tip| tip >= min_tip as u128)
tx.effective_tip_per_gas(base_fee)
.is_some_and(|tip| tip >= min_tip as u128)
});
let mut best_txs = BestTransactionsWithPrioritizedSenders::new(
local_accounts.clone().unwrap_or_default().into_iter().collect(),
Expand Down Expand Up @@ -421,7 +420,7 @@ where

let ResultAndState { result, state } = match evm.transact() {
Ok(res) => res,
Err(_) => continue
Err(_) => continue,
};
tx_list.push(tx.clone());
// commit changes
Expand All @@ -433,7 +432,7 @@ where
break;
}
buf_len = compressed_buf.len() as u64;
},
}
Err(_) => {
tx_list.pop();
continue
Expand Down

0 comments on commit b2b1066

Please sign in to comment.