fix(api): reject typed nil transport contexts - #16
Merged
Conversation
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linked Issue
Fixes #15
Summary
DeadlineErrNilRootContextandErrNilShutdownContextcontractsRequired Format
feat/,fix/,docs/,test/,refactor/,perf/,security/,chore/,ci/,build/,release/, orrevert/.fix(consensus): reject equivocated proposer slots.Scope And Project Status
No performance claim or user-facing capability is introduced.
Protocol, Safety, And Compatibility
Apply.This changes only invalid local API input handling: a typed nil context now returns the same explicit error as a literal nil context instead of reaching a possible nil-receiver panic. Successful calls are unchanged. There are no releases or runtime users, so no compatibility layer is needed.
Validation
git diff --checkpython3 scripts/check_docs.pygo mod verifyand a cleango mod tidydiffgo vet ./...go test -count=1 -mod=readonly ./...go test -race -count=1 -mod=readonly ./...python3 scripts/check_go_architecture.pyAdditional focused validation:
go test -count=50 ./pkg/api/httpserver ./pkg/api/grpcservergo test -race -count=50 ./pkg/api/httpserver ./pkg/api/grpcserveramd64andarm64static builds with-trimpathProtocol, storage, Byzantine, partition, snapshot, and chaos suites are not applicable to this constructor/shutdown input-validation fix.
Risk And Rollback
Risk is minimal and limited to callers that supplied a typed nil context and relied on undefined panic-prone behavior. Literal nil and all valid contexts retain their existing behavior.
Rollback by reverting this commit; no schema, dependency, data, listener, or migration is involved.