(
&self,
args: BuildArguments<Attrs, BaseBuiltPayload<N>>,
best: impl FnOnce(BestTransactionsAttributes) -> Txs + Send + Sync + 'a,
)
| 176 | fields(payload_id = tracing::field::Empty, parent_num = tracing::field::Empty) |
| 177 | )] |
| 178 | fn build_payload<'a, Txs>( |
| 179 | &self, |
| 180 | args: BuildArguments<Attrs, BaseBuiltPayload<N>>, |
| 181 | best: impl FnOnce(BestTransactionsAttributes) -> Txs + Send + Sync + 'a, |
| 182 | ) -> Result<BuildOutcome<BaseBuiltPayload<N>>, PayloadBuilderError> |
| 183 | where |
| 184 | Txs: PayloadTransactions< |
| 185 | Transaction: PoolTransaction<Consensus = N::SignedTx> + BasePooledTx, |
| 186 | >, |
| 187 | { |
| 188 | let BuildArguments { mut cached_reads, config, cancel, best_payload, .. } = args; |
| 189 | |
| 190 | let ctx = BasePayloadBuilderCtx { |
| 191 | evm_config: self.evm_config.clone(), |
| 192 | builder_config: self.config.clone(), |
| 193 | chain_spec: self.client.chain_spec(), |
| 194 | config, |
| 195 | cancel, |
| 196 | best_payload, |
| 197 | }; |
| 198 | tracing::Span::current().record("payload_id", tracing::field::display(ctx.payload_id())); |
| 199 | tracing::Span::current().record("parent_num", ctx.parent().number()); |
| 200 | |
| 201 | let builder = Builder::new(best); |
| 202 | |
| 203 | let state_provider = self.client.state_by_block_hash(ctx.parent().hash())?; |
| 204 | let state = StateProviderDatabase::new(&state_provider); |
| 205 | |
| 206 | if ctx.attributes().no_tx_pool() { |
| 207 | builder.build(state, &state_provider, ctx) |
| 208 | } else { |
| 209 | // sequencer mode we can reuse cachedreads from previous runs |
| 210 | builder.build(cached_reads.as_db_mut(state), &state_provider, ctx) |
| 211 | } |
| 212 | .map(|out| out.with_cached_reads(cached_reads)) |
| 213 | } |
| 214 | |
| 215 | /// Computes the witness for the payload. |
| 216 | pub fn payload_witness( |
no test coverage detected