Skip to content

Commit

Permalink
fix(raiko): fix sticky invalid tx state (#184)
Browse files Browse the repository at this point in the history
* fix sticky invalid tx state

* update default beacon rpc node

* clear state earlier so we can be sure it's done in all different cases
  • Loading branch information
Brechtpd authored May 11, 2024
1 parent 970328c commit 99f5580
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion host/src/preflight.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ async fn get_blob_data_beacon(
// pub signed_block_header: SignedBeaconBlockHeader, // ignore for now
pub kzg_commitment: String,
pub kzg_proof: String,
pub kzg_commitment_inclusion_proof: Vec<String>,
//pub kzg_commitment_inclusion_proof: Vec<String>,
}

#[derive(Clone, Debug, Deserialize, Serialize)]
Expand Down
2 changes: 1 addition & 1 deletion host/src/raiko.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ mod tests {
block_number,
rpc: "https://rpc.hekla.taiko.xyz".to_string(),
l1_rpc: "https://ethereum-holesky-rpc.publicnode.com".to_string(),
beacon_rpc: "https://api.holesky.blobscan.com".to_string(),
beacon_rpc: "https://eth-holesky-beacon.public.blastapi.io".to_string(),
network,
graffiti: B256::ZERO,
prover: Address::ZERO,
Expand Down
6 changes: 5 additions & 1 deletion lib/src/builder/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// limitations under the License.

use core::{fmt::Debug, mem::take, str::from_utf8};
use std::collections::HashSet;

use alloy_consensus::{constants::BEACON_ROOTS_ADDRESS, TxEnvelope};
use alloy_primitives::{TxKind, U256};
Expand All @@ -29,7 +30,7 @@ use revm::{
Account, Address, EVMError, HandlerCfg, ResultAndState, SpecId, TransactTo, TxEnv,
MAX_BLOB_GAS_PER_BLOCK,
},
taiko, Database, DatabaseCommit, Evm,
taiko, Database, DatabaseCommit, Evm, JournaledState,
};

use super::{OptimisticDatabase, TxExecStrategy};
Expand Down Expand Up @@ -234,6 +235,9 @@ impl TxExecStrategy for TkoTxExecStrategy {
let ResultAndState { result, state } = match evm.transact() {
Ok(result) => result,
Err(err) => {
// Clear the state for the next tx
evm.context.evm.journaled_state = JournaledState::new(spec_id, HashSet::new());

if is_optimistic {
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion script/prove-block.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ elif [ "$chain" == "taiko_a6" ]; then
elif [ "$chain" == "taiko_a7" ]; then
rpc="https://rpc.hekla.taiko.xyz"
l1Rpc="https://ethereum-holesky-rpc.publicnode.com"
beaconRpc="https://api.holesky.blobscan.com"
beaconRpc="https://eth-holesky-beacon.public.blastapi.io"
else
echo "Invalid chain name. Please use 'ethereum', 'taiko_a6' or 'taiko_a7'."
exit 1
Expand Down

0 comments on commit 99f5580

Please sign in to comment.