Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add runtime scheduling constraints #3689

Merged
merged 4 commits into from
Feb 19, 2021

Conversation

kostko
Copy link
Member

@kostko kostko commented Feb 10, 2021

Fixes #3644

TODO

  • Actually implement the new constraints (validator set membership, max nodes per entity).
  • Fix runtime descriptor generation CLI to properly support constraints.
  • Basic validation of constraints structure.
  • Tests.
  • Cleanup.

@kostko kostko force-pushed the kostko/feature/rt-eligibility-constraints branch 4 times, most recently from 5a061e4 to 96db053 Compare February 11, 2021 13:31
@codecov
Copy link

codecov bot commented Feb 11, 2021

Codecov Report

Merging #3689 (c4d1f0b) into master (1133df4) will increase coverage by 0.18%.
The diff coverage is 86.71%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3689      +/-   ##
==========================================
+ Coverage   66.62%   66.80%   +0.18%     
==========================================
  Files         400      400              
  Lines       39660    39769     +109     
==========================================
+ Hits        26424    26569     +145     
+ Misses       9460     9418      -42     
- Partials     3776     3782       +6     
Impacted Files Coverage Δ
go/registry/api/runtime.go 43.97% <ø> (-2.50%) ⬇️
go/worker/storage/committee/checkpoint_sync.go 73.49% <ø> (ø)
go/scheduler/api/api.go 59.03% <65.00%> (+7.52%) ⬆️
go/worker/compute/executor/committee/node.go 68.20% <66.66%> (-0.32%) ⬇️
...o/consensus/tendermint/apps/scheduler/scheduler.go 72.23% <80.64%> (+7.59%) ⬆️
go/oasis-node/cmd/registry/runtime/runtime.go 61.71% <95.65%> (+3.22%) ⬆️
go/consensus/tendermint/apps/roothash/roothash.go 73.95% <100.00%> (-0.18%) ⬇️
go/consensus/tendermint/apps/scheduler/genesis.go 31.29% <100.00%> (-0.05%) ⬇️
go/registry/tests/tester.go 91.60% <100.00%> (+0.12%) ⬆️
go/roothash/api/commitment/pool.go 70.00% <100.00%> (ø)
... and 43 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1133df4...c4d1f0b. Read the comment docs.

@kostko kostko force-pushed the kostko/feature/rt-eligibility-constraints branch from 96db053 to c443d15 Compare February 12, 2021 12:06
@kostko kostko marked this pull request as ready for review February 12, 2021 12:06
@kostko kostko force-pushed the kostko/feature/rt-eligibility-constraints branch 2 times, most recently from e5da82b to 81a07c4 Compare February 12, 2021 12:38
entropy,
stakeAcc,
entitiesEligibleForReward,
validatorEntities,
Copy link
Contributor

Choose a reason for hiding this comment

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

ℹ️ this is the one that's added

go/consensus/tendermint/apps/scheduler/scheduler.go Outdated Show resolved Hide resolved
go/consensus/tendermint/apps/scheduler/scheduler.go Outdated Show resolved Hide resolved
@@ -113,10 +111,6 @@ func (e *ExecutorParameters) ValidateBasic() error {
return fmt.Errorf("round timeout too small")
}

if e.MinPoolSize < e.GroupSize+e.GroupBackupSize {
return fmt.Errorf("minimum pool size too small")
Copy link
Contributor

Choose a reason for hiding this comment

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

do these checks get reinstated elsewhere?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, we could add them back to catch nonsensical configs.

backupSize = int(rt.Executor.GroupBackupSize)
minPoolSize = int(rt.Executor.MinPoolSize)
groupSizes[scheduler.RoleWorker] = int(rt.Executor.GroupSize)
groupSizes[scheduler.RoleBackupWorker] = int(rt.Executor.GroupBackupSize)
Copy link
Contributor

Choose a reason for hiding this comment

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

this makes me wonder about moving the GroupSize and GroupBackupSize into the SchedulingConstraints, like this change does with MinPoolSize. are there other places where we like having it separate like this?

Copy link
Member Author

Choose a reason for hiding this comment

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

He he, I had the exact same thought as well. It would definitely make things nicer.

@kostko kostko force-pushed the kostko/feature/rt-eligibility-constraints branch 5 times, most recently from 21271e9 to 8abb171 Compare February 18, 2021 16:54
Attribute(KeyExecutionDiscrepancyDetected, cbor.Marshal(tagV)).
Attribute(KeyRuntimeID, ValueRuntimeID(runtime.ID)),
)
// This was already handled above, so it should not happen.
Copy link
Contributor

Choose a reason for hiding this comment

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

control shouldn't reach here, or just nothing left to do? we don't return early in the if added above

Copy link
Member Author

@kostko kostko Feb 19, 2021

Choose a reason for hiding this comment

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

The branch added above will overwrite err and the repeated TryFinalize cannot (currently) return the "discrepancy detected" error. So control shouldn't reach here.

@@ -1095,6 +1120,7 @@ func setupDiscrepancy(
sks []signature.Signer,
committee *scheduler.Committee,
nl NodeLookup,
enoughBackupCommits bool,
Copy link
Contributor

Choose a reason for hiding this comment

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

ℹ️ due to some overlap between the worker and backup committees, some tests for worker bad behavior also result in missing backup commits

Copy link
Contributor

@pro-wh pro-wh left a comment

Choose a reason for hiding this comment

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

'worker' and 'backup' roles are no longer exclusive with each other. that results in pretty extensive changes.

@kostko kostko force-pushed the kostko/feature/rt-eligibility-constraints branch from 8abb171 to 8e04fa2 Compare February 19, 2021 10:20
@kostko kostko force-pushed the kostko/feature/rt-eligibility-constraints branch from 8e04fa2 to c4d1f0b Compare February 19, 2021 12:44
@kostko kostko merged commit 9998dea into master Feb 19, 2021
@kostko kostko deleted the kostko/feature/rt-eligibility-constraints branch February 19, 2021 13:23
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.

Additional runtime eligibility constraints
4 participants