Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Cross-msgs check in block validation critical path #148

Open
adlrocha opened this issue Mar 17, 2022 · 0 comments
Open

Cross-msgs check in block validation critical path #148

adlrocha opened this issue Mar 17, 2022 · 0 comments

Comments

@adlrocha
Copy link
Collaborator

adlrocha commented Mar 17, 2022

Checking BottomUpMsgs in a block relies on resolving content from other subnets. This check is int the critical path for block validation and it may delay the process a lot (or even stall it) while it waits to receive the right content from the subnet. We should remove this check or think of better ways of doing it.

func checkBottomUpMsg(ctx context.Context, r *resolver.Resolver, snstore blockadt.Store, snSCA *sca.SCAState, msg *types.Message) error {

// FIXME: This approach may affect the liveliness of hierarchical consensus.
// Assuming data availability and honest nodes we should include a fallback
// scheme to prevent the protocol from stalling.
for i := toApply; i < toApply+uint64(len(metas)); i++ {
cross, ok := isFound[i]
// If not found, return
if !ok {
return out, nil
}
// The pool waits a few epochs before re-proposing a cross-msg if the applied nonce
// hasn't changed in order to give enough time for state changes to propagate.
if s.cm.isBottomUpApplied(i, id, height) {
continue
}
for _, m := range cross {
// Add the meta nonce to the message nonce
m.Nonce = i
// Append for return
out = append(out, &m)
}
s.cm.applyBottomUp(i, id, height)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant