|
| 1 | +use alloy_primitives::{Address, Bloom, Bytes, B256}; |
| 2 | + |
| 3 | +/// The type representing UltraSound bid adjustments. |
| 4 | +#[derive( |
| 5 | + PartialEq, |
| 6 | + Eq, |
| 7 | + Clone, |
| 8 | + Debug, |
| 9 | + serde::Serialize, |
| 10 | + serde::Deserialize, |
| 11 | + ssz_derive::Encode, |
| 12 | + ssz_derive::Decode, |
| 13 | +)] |
| 14 | +pub struct BidAdjustmentData { |
| 15 | + /// State root of the payload. |
| 16 | + pub state_root: B256, |
| 17 | + /// Transactions root of the payload. |
| 18 | + pub transactions_root: B256, |
| 19 | + /// Receipts root of the payload. |
| 20 | + pub receipts_root: B256, |
| 21 | + /// The usual builder address that pays the proposer in the last transaction of the block. |
| 22 | + /// When we adjust a bid, this transaction is overwritten by a transaction from the collateral |
| 23 | + /// account `fee_payer_address`. If we don't adjust the bid, `builder_address` pays the |
| 24 | + /// proposer as per usual. |
| 25 | + pub builder_address: Address, |
| 26 | + /// The state proof for the builder account. |
| 27 | + pub builder_proof: Vec<Bytes>, |
| 28 | + /// The proposer's fee recipient. |
| 29 | + pub fee_recipient_address: Address, |
| 30 | + /// The state proof for the fee recipient account. |
| 31 | + pub fee_recipient_proof: Vec<Bytes>, |
| 32 | + /// The fee payer address that is custodied by the relay. |
| 33 | + pub fee_payer_address: Address, |
| 34 | + /// The state proof for the fee payer account. |
| 35 | + pub fee_payer_proof: Vec<Bytes>, |
| 36 | + /// The merkle proof for the last transaction in the block, which will be overwritten with a |
| 37 | + /// payment from `fee_payer` to `fee_recipient` if we adjust the bid. |
| 38 | + pub placeholder_transaction_proof: Vec<Bytes>, |
| 39 | + /// The merkle proof for the receipt of the placeholder transaction. It's required for |
| 40 | + /// adjusting payments to contract addresses. |
| 41 | + pub placeholder_receipt_proof: Vec<Bytes>, |
| 42 | +} |
| 43 | + |
| 44 | +/// The type for bid adjustments in optimistic v3. |
| 45 | +/// Ref: <https://github.com/ultrasoundmoney/docs/blob/main/optimistic-v3.md#optimistic-v3> |
| 46 | +#[derive( |
| 47 | + PartialEq, |
| 48 | + Eq, |
| 49 | + Clone, |
| 50 | + Debug, |
| 51 | + serde::Serialize, |
| 52 | + serde::Deserialize, |
| 53 | + ssz_derive::Encode, |
| 54 | + ssz_derive::Decode, |
| 55 | +)] |
| 56 | +pub struct BidAdjustmentDataV2 { |
| 57 | + /// Transactions root of the payload. |
| 58 | + pub el_transactions_root: B256, |
| 59 | + /// Withdrawals root of the payload. |
| 60 | + pub el_withdrawals_root: B256, |
| 61 | + /// The usual builder address that pays the proposer in the last transaction of the block. |
| 62 | + /// When we adjust a bid, this transaction is overwritten by a transaction from the collateral |
| 63 | + /// account `fee_payer_address`. If we don't adjust the bid, `builder_address` pays the |
| 64 | + /// proposer as per usual. |
| 65 | + pub builder_address: Address, |
| 66 | + /// The state proof for the builder account. |
| 67 | + pub builder_proof: Vec<Bytes>, |
| 68 | + /// The proposer's fee recipient. |
| 69 | + pub fee_recipient_address: Address, |
| 70 | + /// The state proof for the fee recipient account. |
| 71 | + pub fee_recipient_proof: Vec<Bytes>, |
| 72 | + /// The fee payer address that is custodied by the relay. |
| 73 | + pub fee_payer_address: Address, |
| 74 | + /// The state proof for the fee payer account. |
| 75 | + pub fee_payer_proof: Vec<Bytes>, |
| 76 | + /// The merkle proof for the last transaction in the block, which will be overwritten with a |
| 77 | + /// payment from `fee_payer` to `fee_recipient` if we adjust the bid. |
| 78 | + pub el_placeholder_transaction_proof: Vec<Bytes>, |
| 79 | + /// New in V2: SSZ merkle proof for last transaction |
| 80 | + pub cl_placeholder_transaction_proof: Vec<B256>, |
| 81 | + /// The merkle proof for the receipt of the placeholder transaction. It's required for |
| 82 | + /// adjusting payments to contract addresses. |
| 83 | + pub placeholder_receipt_proof: Vec<Bytes>, |
| 84 | + /// New in V2: Logs bloom accrued until but not including the last (payment) transaction. |
| 85 | + pub pre_payment_logs_bloom: Bloom, |
| 86 | +} |
0 commit comments