Skip to content

Conversation

kamuikatsurgi
Copy link
Member

Description

TestDecodeErigonStateSyncReceipt verifies that Bor can decode state sync receipts sent by Erigon nodes over P2P using eth/69 protocol. The RLP data is captured from actual Erigon state sync receipt generation.

Copy link

t.Fatal("Empty RLP bytes")
}

var data storedReceiptRLP
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good if we can decode based on how it's done here using ReceiptList where you can explicitly use ReceiptList69 struct instead of the generic parameter L.

receiptType := LegacyTxType

// Verify it's a state sync receipt (CumulativeGasUsed = 0).
if data.CumulativeGasUsed != 0 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only the case if block only contained state-sync receipt and nothing else. It would be good if we can include a case which has normal receipts + state-sync receipts. In that case, the cumulative gas field in state-sync receipt would be equal to the value in last normal receipt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants