Skip to content

Conversation

@EclesioMeloJunior
Copy link
Member

Changes

  • Implements active leaves update signal handler for Statement Distribution subsystem

Tests

go test -timeout 30s github.com/ChainSafe/gossamer/dot/parachain/statement-distribution -v

Issues

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know it's out of the scop for this PR but still i am curious to know why do we have rx_ as prefix of this file name? by any chance if you know

Comment on lines +119 to +127
if len(disableValidatorsSet) > 0 {
disabled := make([]parachaintypes.ValidatorIndex, len(disableValidatorsSet))
for d := range disableValidatorsSet {
disabled = append(disabled, d)
}

logger.Debugf("disabled validators detected: %v, "+
"session index=%v, relay parent=%s", disabled, sessionIdx, rp.String())
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need this?

for coreIdx, paras := range schedule {
groupIdx := groupRotationInfo.GroupForCore(coreIdx, uint(numCores))

assignmentsPerGroup[groupIdx] = slices.Clone(paras)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are not modifying the paras so i don't think we need to clone the it.

Suggested change
assignmentsPerGroup[groupIdx] = slices.Clone(paras)
assignmentsPerGroup[groupIdx] = paras

ParachainHostMinimumBackingVotes().
Return(uint32(3), nil)

featuresBitVec, err := parachaintypes.NewBitVec([]bool{true, true, false, true})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a good practice to have a type in a variable name.
We can rename this to nodeFeatures or features.

Comment on lines +134 to +150
wg := sync.WaitGroup{}
wg.Add(1)
go func() {
defer wg.Done()
hypotheticalMsg := <-overseerCh
msg, ok := hypotheticalMsg.(prospectiveparachainsmessages.GetHypotheticalMembership)
require.True(t, ok)

// just return an empty slice
msg.Response <- []*prospectiveparachainsmessages.HypotheticalMembershipResponseItem{}
}()

// The actual sendPeerMessagesForRelayParent will run, but we can't assert its call directly.
// Instead, we just ensure no panic and no error.
err = sd.handleActiveLeavesUpdate(activatedLeaf)
require.NoError(t, err)
wg.Wait()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as you have used require.True inside the go routine, the test will not fail.
you can use mock overseer implementaion which we have implemented specifically to use in test. (I prefer this)

or handle the error/fail case properly.

require.NoError(t, err)
wg.Wait()

// assertions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's remove unnecessary comments

@EclesioMeloJunior EclesioMeloJunior marked this pull request as ready for review July 3, 2025 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants