Skip to content

resolve_to_key in message pool should resolve at finality for reorg-safety #6891

@sudo-shashank

Description

@sudo-shashank

Lotus resolves to deterministic address at finality to guarantee the ID→key mapping is reorg-stable. We currently resolve against the tipset's parent state, which is safe but does not provide the same reorg-safety guarantee.

fn resolve_to_key(&self, addr: &Address, ts: &Tipset) -> Result<Address, Error> {
let state = StateTree::new_from_root(self.blockstore().clone(), ts.parent_state())
.map_err(|e| Error::Other(e.to_string()))?;
state
.resolve_to_deterministic_addr(self.blockstore(), *addr)
.map_err(|e| Error::Other(e.to_string()))
}

See https://github.com/filecoin-project/lotus/blob/006da4c7e1c1c29ac02b32112c0d205e4085ba35/chain/stmgr/stmgr.go#L347

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

New

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions