-
Notifications
You must be signed in to change notification settings - Fork 243
Self healing open #7189
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
Draft
cjen1-msft
wants to merge
226
commits into
microsoft:main
Choose a base branch
from
cjen1-msft:self-healing-open
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.
Draft
Self healing open #7189
Changes from 217 commits
Commits
Show all changes
226 commits
Select commit
Hold shift + click to select a range
0a63230
Add tla spec
cjen1-msft 859d30d
Update spec to refine safety property
cjen1-msft 9eb305d
Add basic fizzbee spec
cjen1-msft 0bf26f9
Add stateright model
cjen1-msft 2b8a1d6
Update stateright dr spec
cjen1-msft bad8a13
Update Readme.md
cjen1-msft 1965453
Update Readme.md
cjen1-msft 5f066e5
broken version
cjen1-msft 09388e7
refactor
cjen1-msft b991b9d
Restore correct liveness property.
cjen1-msft 4f6de45
Add more checked conditions
cjen1-msft 5a98922
Add reasonably clean curlm support
cjen1-msft 9edf637
Add proper curl and libuv interaction
cjen1-msft c745ade
Pass curl singleton over enclave barrier
cjen1-msft 71c1fb3
Ensure singleton is initialised
cjen1-msft 695f351
Make quote endorsement client use curl_multi
cjen1-msft 2956c38
Add curl to public ccf linked libraryes
cjen1-msft 709228f
fix cond
cjen1-msft 32d1361
Initialise request
cjen1-msft f88d7b5
Fix handler
cjen1-msft 4458c8b
fiddle with pointers
cjen1-msft cdebe29
Fix timeout
cjen1-msft 4ea2bb7
Maybe fix issue?
cjen1-msft 6214b6c
refmt
cjen1-msft a4be0c3
Merge branch 'main' into curlm
cjen1-msft fce77da
Update
cjen1-msft 58eb20c
fmt
cjen1-msft 5b52e3d
remove static_cast
cjen1-msft b876cca
Fix url query
cjen1-msft 68aff99
Add kickstart for curlm and document interaction between libuv and curlm
cjen1-msft 934010f
Refactor interface to make checks more careful.
cjen1-msft c84ba3f
move to a constructor pattern
cjen1-msft 594f536
Add missing nullptr check in curl_socket_callback
cjen1-msft 333c427
Update src/http/curl.h
cjen1-msft 12edb67
Add check and warn of duplicate headers in responses
cjen1-msft 14d827b
Migrate fetch.h to new interface
cjen1-msft 6c44deb
fix
cjen1-msft 1fbd015
Pass through config bits for self-heal-open
cjen1-msft c790f4d
Update test infra to test self-healing-open
cjen1-msft b153e53
Fix undefined request body and multi-threaded access to curl
cjen1-msft fee3559
Runnable checkpoint
cjen1-msft dc6a7ee
Config changes
cjen1-msft 2058180
Add timeouts
cjen1-msft f8981ae
Fix curl put with empty body issue
cjen1-msft 963b6c1
Add test for timeouts
cjen1-msft 4d22d82
Get open working
cjen1-msft c67f032
Get join working (still requires trusting of replacement nodes)
cjen1-msft 207b142
Changes to prevent repeated joins
cjen1-msft 1073177
curl client fixes
cjen1-msft 9d95055
Update network to better integrate with volatile node identities
cjen1-msft b3a1f9b
fmt
cjen1-msft 39da991
Changes to curl to make it close carefully
cjen1-msft 64e3dc8
e2e sho test
cjen1-msft bba91ce
Fix undefined request body and multi-threaded access to curl
cjen1-msft d28af46
Fix curl put with empty body issue
cjen1-msft b4e1d16
Changes to curl to make it close carefully
cjen1-msft 20e54fe
Merge branch 'main' into curlm
cjen1-msft 5626b86
Stop passing the singleton over the enclave boundary
cjen1-msft 7b72ea7
refactor and format curl response interface
cjen1-msft 54f0823
Add and fix for e2e test
cjen1-msft e55f9df
Add license
cjen1-msft af81c10
fmt
cjen1-msft eb0dcd0
Fix bug in fetch code
cjen1-msft 86f624f
Reuse response to skip a copy
cjen1-msft ebf73b4
tidy
cjen1-msft 0152a4e
Tidy up
cjen1-msft 0d85ab8
Merge branch 'curlm' into self-healing-open
cjen1-msft 64da579
Testing changes to test testing infra
cjen1-msft fa52e9b
transition_to_open immediately on OPENING rather than waiting for a t…
cjen1-msft 5205458
Update src/http/curl.h
cjen1-msft 080ded9
Ensure opening replica sends iamopen messages
cjen1-msft 60a66c3
Make ownership more explicit.
cjen1-msft d0fe1f3
Fix clang-tidy gripe
cjen1-msft e6bfb0b
Separate response_body from response_headers
cjen1-msft d716c8b
Remove easy handle before throwing an error.
cjen1-msft 62b99ed
Merge branch 'main' into curlm
achamayou b6352c0
Update src/http/curl.h
cjen1-msft a23a882
Update src/http/curl.h
cjen1-msft 7f55f13
Snagging
cjen1-msft 5282f19
Snags
cjen1-msft 03a8d5d
Rejig logic around header processing
cjen1-msft 8cfb104
Set a 1mb default maximum size
cjen1-msft 9b59d25
fix maximum sizing to be sane but not yet configurable for quote endo…
cjen1-msft ef1f464
Make quote endorsements maximum response size configurable.
cjen1-msft acbdcb1
fmt
cjen1-msft 2e1089c
Rephrase
cjen1-msft 6e05563
reboop
cjen1-msft df7c7d4
Merge branch 'curlm' into self-healing-open
cjen1-msft 6fa1587
Ensure attaching request check curl_request_curlm
cjen1-msft 63c4383
Merge branch 'main' into curlm
achamayou 51b4f3b
Reformat
cjen1-msft ad47f4f
Merge branch 'main' into curlm
achamayou 5a8de4a
Add trace logging of timeout actions
cjen1-msft 02bb533
Add tests for slow requests and timed out requests.
cjen1-msft ff72e76
Make e2e_curl a long test
cjen1-msft 1dc290c
Add logging on all curl requests
cjen1-msft fd39352
Add debug print for all unclosed uv handles
cjen1-msft 699445c
fix
cjen1-msft 6fa7169
Refactor closing logic
cjen1-msft 068cc59
Improve lifetime handling of the requestcontext uv_handle
cjen1-msft 9e0ae3d
Revert "Improve lifetime handling of the requestcontext uv_handle"
cjen1-msft 6830d02
Just close the handle when closing the socket
cjen1-msft d18a950
Merge branch 'main' into curlm
cjen1-msft a4235ac
Use a queue to manage curl requests.
cjen1-msft aeeef5f
Fix test
cjen1-msft a04a755
move for attachment
cjen1-msft 20041ea
fmt
cjen1-msft 9a2ba9a
Revert "Fix test"
cjen1-msft 03f0590
All instantiating new proxy_ptrs from a pointer
cjen1-msft a4f234c
Fix asan errors
cjen1-msft 6a083b3
refmt
cjen1-msft 0578b15
Merge branch 'main' into curlm
achamayou 8b7cedd
Don't have a default...
cjen1-msft 31e1b5f
Explicitly drain deque
cjen1-msft 29d6a9d
fmt
cjen1-msft 4b910b8
Fix asan failure
cjen1-msft 27be8e9
Snags
cjen1-msft 259522d
Bump js max_execution_time from 1s to 5s
cjen1-msft 47aff71
Also bump limits test limit
cjen1-msft ed0d4f0
e2e_curl should use a random port
cjen1-msft 5198f4d
Merge branch 'main' into curlm
cjen1-msft b93ab79
Use ipv4 (127.0.0.1) and a random port
cjen1-msft a94de31
Merge branch 'curlm' into self-healing-open
cjen1-msft 8e9e2ff
Merge branch 'main' into self-healing-open
cjen1-msft 2ead593
fmt
cjen1-msft 3ecfd7e
Refactor sho out of recovery config
cjen1-msft 8384d1a
Fixup curl calls
cjen1-msft 5a9fa04
Just stop when recv iamopen
cjen1-msft efe59bb
refactor config
cjen1-msft 64779bd
Make build
cjen1-msft ef70b52
refmt
cjen1-msft c1a7aed
Get a single test to pass! woop woop
cjen1-msft 30344fd
And do the other tests as well...
cjen1-msft 84960c0
snags
cjen1-msft b55ac60
Cleanup
cjen1-msft e102af9
Cleanup
cjen1-msft a955313
Merge pull request #2 from cjen1-msft/modelling-autoopen
cjen1-msft 4a7b3a5
Large refactor to pull out the self_healing_open code from node_state.h
cjen1-msft f16c452
Inline to prevent ODR violations
cjen1-msft 8003292
make cmake happy
cjen1-msft d21d71f
fmt
cjen1-msft 1dc62d0
Fixup todo
cjen1-msft 3e04eb4
clean imports diff
cjen1-msft 465e1df
Merge branch 'main' into self-healing-open
cjen1-msft 9b5d6b6
Fix clang-tidy errors
cjen1-msft 7950eb7
error reporter imports
cjen1-msft 45f54f0
remove extra e2e_curl
cjen1-msft e0fa598
Merge branch 'main' into self-healing-open
cjen1-msft f0175d9
Basic running test
cjen1-msft e9cb10d
Allow curl handles to fix themselves during shutdown.
cjen1-msft 8c8816c
Allow nodes to restart before refreshing network state
cjen1-msft 1c8d6cb
Log restart
cjen1-msft 753d511
Test timeout path
cjen1-msft 58ffb4d
Local sealing self-healing-open
cjen1-msft 0d9283a
Merge branch 'main' into self-healing-open
cjen1-msft bf08f9c
fmt
cjen1-msft abeccda
fixup test
cjen1-msft 53a9139
Ensure sealed secrets are passed
cjen1-msft 6b82bf3
fixup timeout path
cjen1-msft db6fb56
Improve test infra
cjen1-msft 4c527e2
fixup
cjen1-msft d05b745
imports
cjen1-msft a4b6d83
Make NodeState a shared_ptr
cjen1-msft 300b13b
Make clang-tidy happy
cjen1-msft cae83b7
Pass shared_ptr
cjen1-msft f0b0fd5
tidying
cjen1-msft 2cf40b2
tidying 2
cjen1-msft 2e4ca7c
Revert shared_ptr node_state
cjen1-msft cbc1513
Stop skipping timers
cjen1-msft 2430e17
Ensure we initialise self-healing-open state
cjen1-msft ec72561
Ensure we use the correct timeout for failovers
cjen1-msft d5e96e0
sigh
cjen1-msft 29b4de4
Update cchost_config
cjen1-msft 85538ec
Reformat frontend
cjen1-msft 2543e1d
fmt
cjen1-msft fbbf5f9
Remove old tla spec
cjen1-msft 49cce91
Update network.py to coalesce ledger secrets
cjen1-msft 22dca96
Fix network.py
cjen1-msft afb4a1d
Add docs
cjen1-msft fd8750b
Add flag for detecting whether a timeout has occurred during self-hea…
cjen1-msft 13e05b7
Doc update
cjen1-msft a9ab437
typo
cjen1-msft 474b199
Update path names
cjen1-msft c06895c
Revert "Allow curl handles to fix themselves during shutdown."
cjen1-msft 499ea78
Merge branch 'main' into self-healing-open
cjen1-msft 7e5af0d
Update docs
cjen1-msft 009a1c1
Make clang-tidy happy
cjen1-msft 9e7d6e0
Update doc/host_config_schema/cchost_config.json
cjen1-msft f01931a
Update doc/operations/recovery.rst
cjen1-msft 125a0fb
Update src/common/configuration.h
cjen1-msft be6edc9
typoing
cjen1-msft 7ee3d5b
config snags
cjen1-msft ccb43b7
inline restarter
cjen1-msft af6757f
Refactoring
cjen1-msft a83a44e
Don't use network.tables anymore
cjen1-msft 56ebb3e
Refactor and document
cjen1-msft cb23343
rejig
cjen1-msft e977b74
de-replica-ing
cjen1-msft c3a8a46
improved error messages
cjen1-msft d6827c9
Refactor node_frontend
cjen1-msft eacbf66
fmt
cjen1-msft 0e25ca7
Add model checking
cjen1-msft e9b5c4c
Setup rustfmt
cjen1-msft c3f2b79
fmt
cjen1-msft 750e259
Remove rustfmt for separate PR
cjen1-msft b8126ee
fmt
cjen1-msft 6807ae0
Ensure inheritance works as expected
cjen1-msft b69730d
Fix docs
cjen1-msft 3c84f45
Fix doc
cjen1-msft 844b03e
Merge branch 'main' into self-healing-open
cjen1-msft dba3919
Clean up old validation code
cjen1-msft a78b806
Fix race condition around quote endorsements, where they are wiped af…
cjen1-msft d44d512
Merge branch 'main' into self-healing-open
cjen1-msft 98dd582
Allow difference between ledgers as they are different networks
cjen1-msft 66b0460
More logging for curl
cjen1-msft 9f2fc57
Fix curl write to nullptr
cjen1-msft 833d3ca
Merge branch 'main' into self-healing-open
cjen1-msft 6f8d380
Move everything sensible into ccf::self_healing_open::X
cjen1-msft d6716d1
Merge branch 'main' into self-healing-open
cjen1-msft b3d4574
Migrate callback to new curl interface
cjen1-msft c37a341
refmt
cjen1-msft b33310e
Merge branch 'main' into self-healing-open
cjen1-msft 4180851
Don't pass self-healing-open-addresses in regular recovery
cjen1-msft 1c34ca9
Merge branch 'main' into self-healing-open
cjen1-msft 2aed9ca
Reformat
cjen1-msft 169618c
fmt
cjen1-msft 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
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
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,76 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the Apache 2.0 License. | ||
| #pragma once | ||
|
|
||
| #include "ccf/ds/enum_formatter.h" | ||
| #include "ccf/ds/json.h" | ||
| #include "ccf/ds/quote_info.h" | ||
| #include "ccf/service/map.h" | ||
|
|
||
| using IntrinsicIdentifier = std::string; | ||
|
|
||
| struct SelfHealingOpenNodeInfo | ||
achamayou marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| { | ||
| ccf::QuoteInfo quote_info; | ||
| std::string published_network_address; | ||
| std::vector<uint8_t> cert_der; | ||
| std::string service_identity; | ||
| IntrinsicIdentifier intrinsic_id; | ||
| }; | ||
|
|
||
| DECLARE_JSON_TYPE(SelfHealingOpenNodeInfo); | ||
| DECLARE_JSON_REQUIRED_FIELDS( | ||
| SelfHealingOpenNodeInfo, | ||
| quote_info, | ||
| published_network_address, | ||
| cert_der, | ||
| service_identity, | ||
| intrinsic_id); | ||
|
|
||
| enum class SelfHealingOpenSM | ||
| { | ||
| GOSSIPING = 0, | ||
| VOTING, | ||
| OPENING, // by chosen node | ||
| JOINING, // by all other replicas | ||
| OPEN, | ||
| }; | ||
|
|
||
| DECLARE_JSON_ENUM( | ||
| SelfHealingOpenSM, | ||
| {{SelfHealingOpenSM::GOSSIPING, "Gossiping"}, | ||
| {SelfHealingOpenSM::VOTING, "Voting"}, | ||
| {SelfHealingOpenSM::OPENING, "Opening"}, | ||
| {SelfHealingOpenSM::JOINING, "Joining"}, | ||
| {SelfHealingOpenSM::OPEN, "Open"}}); | ||
|
|
||
| namespace ccf | ||
| { | ||
| using SelfHealingOpenNodeInfoMap = | ||
| ServiceMap<IntrinsicIdentifier, ::SelfHealingOpenNodeInfo>; | ||
| using SelfHealingOpenGossips = | ||
| ServiceMap<IntrinsicIdentifier, ccf::kv::Version>; | ||
| using SelfHealingOpenChosenNode = ServiceValue<IntrinsicIdentifier>; | ||
| using SelfHealingOpenVotes = ServiceSet<IntrinsicIdentifier>; | ||
| using SelfHealingOpenSMState = ServiceValue<SelfHealingOpenSM>; | ||
| using SelfHealingOpenTimeoutSMState = ServiceValue<SelfHealingOpenSM>; | ||
| using SelfHealingOpenFailoverFlag = ServiceValue<bool>; | ||
|
|
||
| namespace Tables | ||
| { | ||
| static constexpr auto SELF_HEALING_OPEN_NODES = | ||
| "public:ccf.gov.selfhealingopen.nodes"; | ||
| static constexpr auto SELF_HEALING_OPEN_GOSSIPS = | ||
| "public:ccf.gov.selfhealingopen.gossip"; | ||
| static constexpr auto SELF_HEALING_OPEN_CHOSEN_NODE = | ||
| "public:ccf.gov.selfhealingopen.chosen_node"; | ||
| static constexpr auto SELF_HEALING_OPEN_VOTES = | ||
| "public:ccf.gov.selfhealingopen.votes"; | ||
| static constexpr auto SELF_HEALING_OPEN_SM_STATE = | ||
| "public:ccf.gov.selfhealingopen.sm_state"; | ||
| static constexpr auto SELF_HEALING_OPEN_TIMEOUT_SM_STATE = | ||
| "public:ccf.gov.selfhealingopen.timeout_sm_state"; | ||
| static constexpr auto SELF_HEALING_OPEN_FAILOVER_FLAG = | ||
| "public:ccf.gov.selfhealingopen.failover_open"; | ||
| } | ||
| } | ||
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.
Uh oh!
There was an error while loading. Please reload this page.