MCPcopy Create free account
hub / github.com/base/base / build

Method build

crates/consensus/engine/src/task_queue/core.rs:86–128  ·  view source on GitHub ↗

Starts a block build directly against the execution layer.

(
        &mut self,
        client: Arc<EngineClient_>,
        config: Arc<RollupConfig>,
        attributes: AttributesWithParent,
    )

Source from the content-addressed store, hash-verified

84
85 /// Starts a block build directly against the execution layer.
86 pub async fn build(
87 &mut self,
88 client: Arc<EngineClient_>,
89 config: Arc<RollupConfig>,
90 attributes: AttributesWithParent,
91 ) -> Result<PayloadId, BuildTaskError> {
92 let _task_timer =
93 base_metrics::timed!(Metrics::engine_task_duration(Metrics::BUILD_TASK_LABEL));
94
95 match Self::build_with_state(&self.state, client.as_ref(), config.as_ref(), attributes)
96 .await
97 {
98 Ok(payload_id) => {
99 Metrics::engine_task_count(Metrics::BUILD_TASK_LABEL).increment(1);
100 Ok(payload_id)
101 }
102 Err(err) => {
103 let severity = err.severity();
104 Metrics::engine_task_failure(Metrics::BUILD_TASK_LABEL, severity.as_label())
105 .increment(1);
106
107 match severity {
108 EngineTaskErrorSeverity::Temporary => {
109 trace!(target: "engine", error = %err, "Temporary engine error");
110 }
111 EngineTaskErrorSeverity::Deferred => {
112 trace!(target: "engine", error = %err, "Deferred engine error");
113 }
114 EngineTaskErrorSeverity::Critical => {
115 error!(target: "engine", error = %err, "Critical engine error");
116 }
117 EngineTaskErrorSeverity::Reset => {
118 warn!(target: "engine", "Engine requested derivation reset");
119 }
120 EngineTaskErrorSeverity::Flush => {
121 warn!(target: "engine", "Engine requested derivation flush");
122 }
123 }
124
125 Err(err)
126 }
127 }
128 }
129
130 /// Starts a block build using the provided engine state.
131 pub async fn build_with_state(

Calls 4

incrementMethod · 0.80
as_refMethod · 0.45
severityMethod · 0.45
as_labelMethod · 0.45