Skip to content

Commit 771fd66

Browse files
committed
fix log validation
1 parent a758336 commit 771fd66

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ cargo run -p op-rbuilder --bin op-rbuilder --features=flashtestations -- node \
6868
- `--flashtestations.enable-block-proofs`: Enable end-of-block transaction proofs that verify the block was built within a TEE
6969
- `--flashtestations.debug`: Enable debug mode with a deterministic TEE key and debug attestation server for testing and development
7070
- `--flashtestations.quote-provider <URL>`: Specify a remote URL to provide an attestation instead of generating a quote in process
71-
- `--flashtestations.rpc-url <URL>`: Use a remote provider to submit attestations to
71+
- `--flashtestations.rpc-url <URL>`: Use a remote rpc provider to submit attestations to
7272

7373
## Observability
7474

crates/op-rbuilder/src/builders/flashblocks/payload.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ where
368368
flashblock_count = flashblock_count,
369369
target_gas = total_gas_per_batch,
370370
gas_used = info.cumulative_gas_used,
371-
target_da = total_da_per_batch.unwrap_or(0),
371+
target_da = total_da_per_batch,
372372
da_used = info.cumulative_da_bytes_used,
373373
"Building flashblock",
374374
);

crates/op-rbuilder/src/flashtestations/builder_tx.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ impl FlashtestationsBuilderTx {
177177

178178
/// Computes the block content hash according to the formula:
179179
/// keccak256(abi.encode(parentHash, blockNumber, timestamp, transactionHashes))
180+
/// https://github.com/flashbots/rollup-boost/blob/main/specs/flashtestations.md#block-building-process
180181
fn compute_block_content_hash(
181182
transactions: Vec<OpTransactionSigned>,
182183
parent_hash: B256,
@@ -269,9 +270,9 @@ impl FlashtestationsBuilderTx {
269270

270271
fn check_tee_address_registered_log(&self, logs: Vec<Log>, address: Address) -> bool {
271272
for log in logs {
272-
if log.topics().len() > 1 && log.topics()[0] == TEEServiceRegistered::SIGNATURE_HASH {
273+
if log.topics().first() == Some(&TEEServiceRegistered::SIGNATURE_HASH) {
273274
if let Ok(decoded) = TEEServiceRegistered::decode_log(&log) {
274-
if decoded.address == address {
275+
if decoded.teeAddress == address {
275276
return true;
276277
}
277278
};
@@ -343,9 +344,7 @@ impl FlashtestationsBuilderTx {
343344

344345
fn check_verify_block_proof_log(&self, logs: Vec<Log>) -> bool {
345346
for log in logs {
346-
if log.topics().len() > 1
347-
&& log.topics()[0] == BlockBuilderProofVerified::SIGNATURE_HASH
348-
{
347+
if log.topics().first() == Some(&BlockBuilderProofVerified::SIGNATURE_HASH) {
349348
return true;
350349
}
351350
}

0 commit comments

Comments
 (0)