Skip to content

Deduplicate state_provider_builder calls in payload validator #20435

@shekhirin

Description

@shekhirin

Summary

There are two implementations of state_provider_builder that could be deduplicated.

match self.state_provider_builder(block_id.parent) {

ensure_ok!(self.state_provider_builder(parent_hash, ctx.state()))

Solution

Instead of discarding the state_provider_builder here

match self.state_provider_builder(block_id.parent) {
pass it as the argument to execute closure inside the ctx
let executed = execute(&mut self.payload_validator, input, ctx)?;
to not create it again here
let Some(provider_builder) =
ensure_ok!(self.state_provider_builder(parent_hash, ctx.state()))

Metadata

Metadata

Assignees

Labels

A-engineRelated to the engine implementationC-perfA change motivated by improving speed, memory usage or disk footprint

Type

No type

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions