-
Notifications
You must be signed in to change notification settings - Fork 29
Added include invalid pending queue items for the vault #2123
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
Open
russell-stern
wants to merge
16
commits into
main
Choose a base branch
from
validate_observations
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
f2aebaf
Added cipherless observation flag for the vault
russell-stern 5a37cb0
Fixed test
russell-stern 14c3194
Updated defaults
russell-stern 7e603d9
Added new flag for relaxed consensus in vault
russell-stern 0d6197d
Removed extra field
russell-stern a8438be
Merge branch 'main' into validate_observations
russell-stern 377fa8e
Remove cipherless observations setting
russell-stern b3cda04
Add skip-invalid pending items flag + ObservationError proto
russell-stern 07623be
Merge branch 'validate_observations' of https://github.com/smartcontr…
russell-stern 4f0348e
Renamed feature flag
russell-stern 7f78bc1
Merge branch 'main' into validate_observations
russell-stern 90f44e7
Added pending queue stall mechanism
russell-stern 097d669
Merge branch 'validate_observations' of https://github.com/smartcontr…
russell-stern ece1c2b
Merge branch 'main' of https://github.com/smartcontractkit/chainlink-…
russell-stern 9ae7e5f
Ran make generate
russell-stern 95959d8
Merge branch 'main' into validate_observations
russell-stern File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| package vault | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
| "github.com/stretchr/testify/require" | ||
| "google.golang.org/protobuf/proto" | ||
| ) | ||
|
|
||
| func TestObservationErrorField_SHAStableForOkObservations(t *testing.T) { | ||
| t.Parallel() | ||
|
|
||
| obs := &Observation{ | ||
| Id: "request-1", | ||
| RequestType: RequestType_DELETE_SECRETS, | ||
| Response: &Observation_DeleteSecretsResponse{ | ||
| DeleteSecretsResponse: &DeleteSecretsResponse{ | ||
| Responses: []*DeleteSecretResponse{{Success: false}}, | ||
| }, | ||
| }, | ||
| } | ||
|
|
||
| before, err := proto.MarshalOptions{Deterministic: true}.Marshal(obs) | ||
| require.NoError(t, err) | ||
|
|
||
| roundTrip := &Observation{} | ||
| require.NoError(t, proto.Unmarshal(before, roundTrip)) | ||
| require.Nil(t, roundTrip.GetError()) | ||
|
|
||
| after, err := proto.MarshalOptions{Deterministic: true}.Marshal(roundTrip) | ||
| require.NoError(t, err) | ||
| require.Equal(t, before, after) | ||
| } | ||
|
|
||
| func TestObservationErrorField_RoundTrip(t *testing.T) { | ||
| t.Parallel() | ||
|
|
||
| obs := &Observation{ | ||
| Id: "request-1", | ||
| RequestType: RequestType_CREATE_SECRETS, | ||
| Error: &ObservationError{ | ||
| Message: "request is not valid", | ||
| }, | ||
| } | ||
|
|
||
| b, err := proto.MarshalOptions{Deterministic: true}.Marshal(obs) | ||
| require.NoError(t, err) | ||
|
|
||
| out := &Observation{} | ||
| require.NoError(t, proto.Unmarshal(b, out)) | ||
| require.Equal(t, "request is not valid", out.GetError().GetMessage()) | ||
| require.Nil(t, out.GetCreateSecretsResponse()) | ||
| } | ||
|
|
||
| func TestPendingQueueStallSignal_DefaultIsWireStable(t *testing.T) { | ||
| t.Parallel() | ||
|
|
||
| obs := &Observations{SortNonce: make([]byte, 32)} | ||
| before, err := proto.MarshalOptions{Deterministic: true}.Marshal(obs) | ||
| require.NoError(t, err) | ||
|
|
||
| roundTrip := &Observations{} | ||
| require.NoError(t, proto.Unmarshal(before, roundTrip)) | ||
| require.Equal(t, PendingQueueStallSignal_PENDING_QUEUE_STALL_SIGNAL_CONTINUE, roundTrip.GetPendingQueueStallSignal()) | ||
|
|
||
| after, err := proto.MarshalOptions{Deterministic: true}.Marshal(roundTrip) | ||
| require.NoError(t, err) | ||
| require.Equal(t, before, after) | ||
| } | ||
|
|
||
| func TestPendingQueueStallSignal_RoundTrip(t *testing.T) { | ||
| t.Parallel() | ||
|
|
||
| obs := &Observations{ | ||
| SortNonce: make([]byte, 32), | ||
| PendingQueueStallSignal: PendingQueueStallSignal_PENDING_QUEUE_STALL_SIGNAL_STALLED, | ||
| } | ||
| b, err := proto.MarshalOptions{Deterministic: true}.Marshal(obs) | ||
| require.NoError(t, err) | ||
|
|
||
| out := &Observations{} | ||
| require.NoError(t, proto.Unmarshal(b, out)) | ||
| require.Equal(t, PendingQueueStallSignal_PENDING_QUEUE_STALL_SIGNAL_STALLED, out.GetPendingQueueStallSignal()) | ||
| } |
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason this is a separate proto and not inlined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly for extensibility later on in case we want to add codes/types