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

1.6 feature merge #4271

Closed
wants to merge 1,161 commits into from
Closed
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
1161 commits
Select commit Hold shift + click to select a range
c90df54
Move TLS related configuration into new type `TLSConfiguration`
marc-casperlabs Feb 16, 2024
03951f1
Use `ConManContext` for sharing info and add the `ProtocolHandler` trait
marc-casperlabs Feb 16, 2024
634414a
Remove unused `DummyPayload`
marc-casperlabs Feb 16, 2024
45fd63f
Simplify `ConMan` code by adopting a refuse-wrong-direction model
marc-casperlabs Feb 16, 2024
9643871
Cleanup documentation and structure around outgoing
marc-casperlabs Feb 18, 2024
d573ec8
Change to approach that deregisters self from routing table on `Drop`
marc-casperlabs Feb 18, 2024
fbda7aa
Update design with separate banlist
marc-casperlabs Feb 18, 2024
442f9ab
More cleanup and refactoring of existing `conman` logic
marc-casperlabs Feb 18, 2024
cf49cae
Sketched first code for outgoing connection management
marc-casperlabs Feb 18, 2024
5112540
Avoid unnecessary spawn when handling incoming connections
marc-casperlabs Feb 18, 2024
b4ce6a6
Cleanup use of `Arc<Self>` and how locks are held in incoming handler
marc-casperlabs Feb 18, 2024
b6b155c
Sketch outgoing handler code
marc-casperlabs Feb 18, 2024
4dc59de
Added first implementation of outgoing connection manager
marc-casperlabs Feb 18, 2024
44b86f8
Added a permanent error backoff
marc-casperlabs Feb 19, 2024
4121476
Make outgoing handler use a `Result` based structure
marc-casperlabs Feb 19, 2024
71f268b
Make `address_book` into a `HashSet`
marc-casperlabs Feb 19, 2024
92c3de7
Honor the should-not-call list
marc-casperlabs Feb 19, 2024
bcdd74b
Take action based on outgoing error
marc-casperlabs Feb 19, 2024
9ce8385
Filter loopback connections
marc-casperlabs Feb 19, 2024
79abb1d
Limit outgoing set
marc-casperlabs Feb 19, 2024
386a75c
Output address when warning about lost address
marc-casperlabs Feb 19, 2024
8cf8507
Add an incoming limiter for accepted connections
marc-casperlabs Feb 19, 2024
53cc20f
Track lost warnings count
marc-casperlabs Feb 19, 2024
9b3129c
Factor out `once_per` parts to `utils`
marc-casperlabs Feb 19, 2024
3d27eaf
Use an actual configuration structure for connection manager
marc-casperlabs Feb 19, 2024
949b47e
Cleanup docs for `conman`
marc-casperlabs Feb 19, 2024
6769d8d
Create `ObservableFuse::spawn` convenience method
marc-casperlabs Feb 19, 2024
357913d
Move `our_id` into context
marc-casperlabs Feb 19, 2024
f04a0b0
Do-not-call list is limited in size as well
marc-casperlabs Feb 19, 2024
9a19136
Fixed race condition that would have caused permanently blocked outgo…
marc-casperlabs Feb 19, 2024
4acb6f6
Enforce address book registration invariant of `OutgoingHandler`
marc-casperlabs Feb 19, 2024
18b6350
Fix two typos in code and message
marc-casperlabs Feb 19, 2024
307b3ae
Also create a `::new` function for `IncomingHandler`
marc-casperlabs Feb 19, 2024
531bb9c
Note that we need to find a solution for recording onto the span
marc-casperlabs Feb 19, 2024
0d79c95
Note that we still need to pass banlist timings to peers
marc-casperlabs Feb 19, 2024
7719dfd
Use `NonZeroUsize` for backoff/attempts in helper function
marc-casperlabs Feb 19, 2024
f09e102
Update `OutgoingHandler` to be more thorough in keeping the routing t…
marc-casperlabs Feb 19, 2024
4923dc9
Add `ActiveRoute` type
marc-casperlabs Feb 19, 2024
1de50e0
Use `ActiveRoute` for both incoming and outgoing connections
marc-casperlabs Feb 19, 2024
10f74f6
Remove `IncomingHandler` in favor of single handling function
marc-casperlabs Feb 19, 2024
3bb8617
Cleanup logging around active routes
marc-casperlabs Feb 19, 2024
5239425
More logging cleanup
marc-casperlabs Feb 19, 2024
e0121e1
Fix issue with duplicate field recording on `Span`
marc-casperlabs Feb 19, 2024
8fa4de1
Fix typo in comment
marc-casperlabs Feb 19, 2024
8905f1c
Rewrite `once_per` as `rate_limited` module, with better performance …
marc-casperlabs Feb 19, 2024
8d65b05
Add external `learn_addr` function for `ConMan`
marc-casperlabs Feb 19, 2024
f92cd2f
Graft `ConMan` onto networking component
marc-casperlabs Feb 19, 2024
d9eacbe
Add connection manager ban support
marc-casperlabs Feb 19, 2024
11f0314
Get node in a roughly compiling state again
marc-casperlabs Feb 20, 2024
a9c9d1b
Remove tarpit feature and other unused parts of the networkin context
marc-casperlabs Feb 20, 2024
cb969dd
Cleanup code handling known addresses
marc-casperlabs Feb 20, 2024
7f9da2e
Allow reading of `ConManState`
marc-casperlabs Feb 20, 2024
0ecb159
Restore message sending functionality
marc-casperlabs Feb 20, 2024
b1c890d
When broadcasting, only serialize message once
marc-casperlabs Feb 20, 2024
6723271
fixed warnings
hoffmannjan Feb 20, 2024
b9c6596
code formatted
hoffmannjan Feb 20, 2024
580fdd6
Restore functionality of `has_sufficient_fully_connected_peers` as `h…
marc-casperlabs Feb 20, 2024
91862e9
Restore functionality of `fully_connected_peers_random` as `connected…
marc-casperlabs Feb 20, 2024
c326865
Restore gossiping to the extent it was before
marc-casperlabs Feb 20, 2024
f98d4ba
Restore `peers` function, changing its signature to return `SocketAdd…
marc-casperlabs Feb 20, 2024
d829d4f
Sketch new protocol handler in `transport` module
marc-casperlabs Feb 20, 2024
9c0501a
Remove reactor event from networking context
marc-casperlabs Feb 21, 2024
0d78d42
Use `()` as the payload for the encoded handshake
marc-casperlabs Feb 21, 2024
1cb7776
Move handshake negotiation into `handshake` module
marc-casperlabs Feb 21, 2024
a69fe38
Put creation of `ConnectionId` into handshake itself
marc-casperlabs Feb 21, 2024
7c8d620
Improve cryptographic security of `ConnectionId`
marc-casperlabs Feb 21, 2024
d7124cb
Use different reconnection delay based on how long we were serving a …
marc-casperlabs Feb 21, 2024
4c835d3
Fixed issue with span registration
marc-casperlabs Feb 21, 2024
116dcbb
Note the possibility of improving reconnection times after a node id …
marc-casperlabs Feb 21, 2024
31ec87c
Complete connection setup portion of `TransportHandler`
marc-casperlabs Feb 21, 2024
8ec81df
Streamline shared code and put in proper timeouts across connection s…
marc-casperlabs Feb 21, 2024
b24b39f
Make tests compile again by removing non-existant `SweepOutgoing` eve…
marc-casperlabs Feb 21, 2024
ad074b1
Moved `TlsConnection` to `transport` module
marc-casperlabs Feb 21, 2024
8c01057
Add a handler for incoming requests to `TransportHandler`
marc-casperlabs Feb 21, 2024
8f89801
Make remote address available on route
marc-casperlabs Feb 21, 2024
9ebf70d
Restore the address functionality of `peers`
marc-casperlabs Feb 21, 2024
a54ae70
Removed `TlsConfiguration` in favor of `Identity`
marc-casperlabs Feb 22, 2024
102208b
Complete transition to networking compnent that throws away all incom…
marc-casperlabs Feb 22, 2024
e6715ed
Remove `REv` type parameter from network
marc-casperlabs Feb 22, 2024
e39138c
Implemented message deserialization on the transport handler
marc-casperlabs Feb 22, 2024
6797471
Properly pass `Span` when scheduling incoming message
marc-casperlabs Feb 22, 2024
8c1d342
Remove obsolete `ConnectionSymmetry` module
marc-casperlabs Feb 22, 2024
221b937
Remove some unused imports
marc-casperlabs Feb 22, 2024
65d7150
Remove unused imports and code in networking
marc-casperlabs Feb 22, 2024
7a8d90e
Make `NetworkContext` disappear
marc-casperlabs Feb 22, 2024
ccfe207
Restore `NetworkInsights`
marc-casperlabs Feb 22, 2024
ba4bcdb
Downgrade less informative log message
marc-casperlabs Feb 22, 2024
ca3d39b
Do not stop gossiping our address if we fail to do so once
marc-casperlabs Feb 22, 2024
82e7067
Properly set `self.public_addr` in initializer
marc-casperlabs Feb 22, 2024
d89dc25
Make equivocator test more readable
marc-casperlabs Feb 23, 2024
92dcb83
Increase message delay in equivocator test
marc-casperlabs Feb 23, 2024
bdbf2df
Disable bubble timeouts, log message sending failures, making equivoc…
marc-casperlabs Feb 23, 2024
a80dab6
Cut unused `xor` utility function
marc-casperlabs Feb 23, 2024
0774357
Report active era and consensus key in networking insights
marc-casperlabs Feb 26, 2024
caf785c
Use a symbolic direction to determine whether or not we should contin…
marc-casperlabs Feb 26, 2024
85133aa
Remove stale import
marc-casperlabs Feb 26, 2024
8af02f5
List routes in network info on diagnostics port
marc-casperlabs Feb 26, 2024
3c3c7cc
Record and report consensus key from handshake in connection insights
marc-casperlabs Feb 26, 2024
5b6d7c1
Record connection duration in networking insights
marc-casperlabs Feb 26, 2024
db2870e
Note future plan to make `unban` included in check
marc-casperlabs Feb 26, 2024
353a049
Change "permanent" backoff timer to 10 minutes
marc-casperlabs Feb 26, 2024
2191624
Repair peers metric
marc-casperlabs Feb 26, 2024
bc1e8c1
Log lost messages
marc-casperlabs Feb 26, 2024
c1a3f5d
Change torture test loglevel for `juliet` by default
marc-casperlabs Feb 26, 2024
a0763a4
Upgrade flaky connection to warning
marc-casperlabs Feb 26, 2024
9bce693
Make `unban` a part of `is_still_banned`
marc-casperlabs Feb 26, 2024
6761f35
Report `blocked` in connection insights
marc-casperlabs Feb 26, 2024
4cb99b4
Report address book and do-not-call-list in network insights
marc-casperlabs Feb 26, 2024
5d2666a
Remove unused `unban` method
marc-casperlabs Feb 26, 2024
43dd370
Update formatting of networking insights
marc-casperlabs Feb 26, 2024
66a5812
Use newer `juliet` version that includes warning messages for injecte…
marc-casperlabs Feb 27, 2024
18d538f
new implementation whith permission checks
hoffmannjan Feb 27, 2024
31ac2cd
Reimplemented burn method
hoffmannjan Feb 28, 2024
5748cc2
Bump `juliet` commit to one that includes first fix for multi-frame s…
marc-casperlabs Feb 28, 2024
dece69d
Bump `juliet` commit to one that includes second fix for multi-frame …
marc-casperlabs Feb 28, 2024
4deb7ec
first test scenerio implemented
hoffmannjan Feb 29, 2024
9f8cc0c
implemented should_not_burn_excess_tokens test
hoffmannjan Feb 29, 2024
353b70b
reimplemented client contract
hoffmannjan Feb 29, 2024
bb09705
fix deserialization error, add demo contract
igor-casper Feb 29, 2024
5b55aa1
fix warnings
hoffmannjan Feb 29, 2024
6ad426a
Read conman configuration from config file
Mar 4, 2024
0c25d47
Fix typo in a comment
Mar 5, 2024
8642b96
Add `bubble_timeouts` to network config
Mar 5, 2024
c8900ab
Add `error_timeout` to network config
Mar 5, 2024
4b96f62
Add `max_frame_size` to network config
Mar 5, 2024
05f0c32
Reduce number of args for `create_rpc_builder()`
Mar 5, 2024
877ec87
Fix typo in the comment
Mar 5, 2024
b986ab6
Use the config values in con man
Mar 5, 2024
ef55228
Use more relaxed backoff for soundness test
Mar 5, 2024
6972655
WIP
hoffmannjan Mar 5, 2024
43a3495
apply review suggestions
igor-casper Mar 5, 2024
9659031
applied fixes to burn contract
hoffmannjan Mar 5, 2024
2c59473
format fixes
hoffmannjan Mar 5, 2024
6173fff
Merge branch 'feat-1.6' into feat-burning
hoffmannjan Mar 5, 2024
6402d2f
apply clippy lints
hoffmannjan Mar 5, 2024
2bc09d6
applied fmt fixes
hoffmannjan Mar 5, 2024
f49269a
added requested changes
hoffmannjan Mar 5, 2024
631cd62
method better naming
hoffmannjan Mar 6, 2024
010a666
Make the `bubble_timeouts` enabled by default
Mar 6, 2024
a46f0f0
Move `maximum_frame_size` from config to chainspec
Mar 7, 2024
6a89178
Rephrase comments
Mar 7, 2024
4a13d72
Add conman config parameters to changelog
Mar 7, 2024
37db66c
Remove the stray `max_frame_size` parameter from the config
Mar 7, 2024
f3aa4c2
Merge pull request #9 from rafal-ch/4554_conman_config_cleanup
marc-casperlabs Mar 8, 2024
b49b2f3
Merge pull request #10 from rafal-ch/4553_change_permanent_error_back…
marc-casperlabs Mar 8, 2024
3898b2b
fix in node/src/components/network/tasks.rs
hoffmannjan Mar 12, 2024
74149a6
added audit ignore
hoffmannjan Mar 12, 2024
db8a42d
Update `juliet` version
marc-casperlabs Mar 12, 2024
376cf94
Remove obsolete TODO
marc-casperlabs Mar 12, 2024
ebdc502
Communicate error that was handled to peer
marc-casperlabs Mar 12, 2024
2a0af13
Send an error after connecting to a banned peer
marc-casperlabs Mar 12, 2024
b0b1930
Also inform incoming peer about its ban
marc-casperlabs Mar 12, 2024
86f007c
Give ban justifications to peer when encountering them
marc-casperlabs Mar 12, 2024
be75b24
Actually disconnect from peers when banning
marc-casperlabs Mar 12, 2024
e8b5445
Stringify ban messages less
marc-casperlabs Mar 12, 2024
adc347c
fixed test
hoffmannjan Mar 12, 2024
4492011
fixed formatting
hoffmannjan Mar 12, 2024
b6f83e5
Make do-not-call-timeout take ban duration into account
marc-casperlabs Mar 12, 2024
16bb5ef
Merge pull request #4573 from hoffmannjan/feat-burning
hoffmannjan Mar 12, 2024
177f9af
Merge remote-tracking branch 'upstream/dev' into feat-1.6
marc-casperlabs Mar 13, 2024
e6b473e
Merge remote-tracking branch 'upstream/feat-1.6' into 4525-connection…
marc-casperlabs Mar 13, 2024
e81202c
Remove obsolete doc comment
marc-casperlabs Mar 13, 2024
e42134d
Fix typo in docs
marc-casperlabs Mar 13, 2024
81542f1
Do not consider removing the `Route`'s `peer` field
marc-casperlabs Mar 13, 2024
06250de
Merge pull request #4551 from marc-casperlabs/4525-connection-management
marc-casperlabs Mar 13, 2024
d56b4a4
Merge remote-tracking branch 'upstream/feat-1.6' into conman-bans
marc-casperlabs Mar 13, 2024
0b7789c
Fix typo in `conman` module
marc-casperlabs Mar 13, 2024
00e768f
Add missing docs for `PeerError::banned`
marc-casperlabs Mar 13, 2024
4e72c0d
Fix another typo
marc-casperlabs Mar 13, 2024
06c7954
Remove obsolete TODO
marc-casperlabs Mar 13, 2024
dea7b0b
Improve `PeerError::YouAreBanned`'s display impl
marc-casperlabs Mar 14, 2024
5263bf0
Merge pull request #4604 from casper-network/conman-bans
marc-casperlabs Mar 14, 2024
57e9a8a
Bump `juliet` version to `0.3.0`
marc-casperlabs Mar 14, 2024
bfaf476
Remove largest specimen check and test
marc-casperlabs Mar 14, 2024
9dbc097
Make exposure of `max_rounds_per_era` a test-only thing
marc-casperlabs Mar 14, 2024
5c5c091
Pick low-hanging `EnumDiscriminants` fruit
marc-casperlabs Mar 14, 2024
b51ad85
Remove `EnumDiscrimnant` implementations hidden behind `relaxed` modules
marc-casperlabs Mar 14, 2024
06a7310
Cleanup `CHANGELOG.md` for next version a bit
marc-casperlabs Mar 14, 2024
3b24e7d
Remove `max_addr_pending_time`
marc-casperlabs Mar 14, 2024
92e30ff
Remove `max_incoming_peer_connections` config setting
marc-casperlabs Mar 14, 2024
48f4db9
Remove `max_outgoing_byte_rate_non_validators` config setting
marc-casperlabs Mar 14, 2024
5f19d9e
Remove tarpit entirely, including its leftover configuration settings
marc-casperlabs Mar 14, 2024
1ad45c4
Merge pull request #4607 from marc-casperlabs/remove-obsolete-network…
marc-casperlabs Mar 14, 2024
b8e6096
Noted networking changes in `CHANGELOG.md`
marc-casperlabs Mar 14, 2024
1c4d3d3
Merge pull request #4608 from marc-casperlabs/4555-update-changelog
marc-casperlabs Mar 14, 2024
52bb5be
Merge pull request #4606 from marc-casperlabs/remove-large-specimen-c…
marc-casperlabs Mar 14, 2024
24d6dea
Note removal of chainspec maximum message size validation
marc-casperlabs Mar 14, 2024
6fbcf49
Remove unused import
marc-casperlabs Mar 14, 2024
d7554ca
Add hooks for establishment/loss of active route on protocol handler
marc-casperlabs Mar 15, 2024
6003534
Established new queue kind `NetworkInternal`, rename existing `Networ…
marc-casperlabs Mar 18, 2024
64d5ec0
Add events for updating the route
marc-casperlabs Mar 18, 2024
ad7c0ed
Add a `key_index` to track validators in conman
marc-casperlabs Mar 18, 2024
70fb4a6
Revert "Add events for updating the route"
marc-casperlabs Mar 18, 2024
78e4cac
Revert "Established new queue kind `NetworkInternal`, rename existing…
marc-casperlabs Mar 18, 2024
55a5c2e
Revert most changes from d7554ca425382c743b464a5e6b745fa915c14d55
marc-casperlabs Mar 18, 2024
38bf284
Restore validator broadcast functionality
marc-casperlabs Mar 18, 2024
da93550
Remove unused `is_active_or_upcoming_validator` method
marc-casperlabs Mar 18, 2024
4122402
Make validator broadcasting configurable
marc-casperlabs Mar 18, 2024
07804ec
Fallback to global broadcast if there are issues
marc-casperlabs Mar 18, 2024
6572a05
Remove redundant check of validator status in broadcasting
marc-casperlabs Mar 18, 2024
f041853
Mention `use_validator_broadcast` in `CHANGELOG`
marc-casperlabs Mar 18, 2024
8249992
Fix typo in docs
marc-casperlabs Mar 18, 2024
12eec20
Handle cases where a consensus key moved across nodes
marc-casperlabs Mar 18, 2024
ddc91c2
Use correct iterator when iterating over all peers
marc-casperlabs Mar 18, 2024
aabbff5
Make usage of validator broadcast the default
marc-casperlabs Mar 19, 2024
06ce95e
Merge pull request #4612 from marc-casperlabs/validator-broadcast
marc-casperlabs Mar 19, 2024
944f17b
Improve documentation of `GossipTarget`
marc-casperlabs Mar 19, 2024
7eaf198
Add `era_validators` function to `ValidatorMatrix`
marc-casperlabs Mar 19, 2024
3dadc6a
Draft new implementation for gossip peer selection
marc-casperlabs Mar 19, 2024
e4f53f8
Cleanup new gossip target selection
marc-casperlabs Mar 19, 2024
3be88f0
Log when gossiper selection falls short
marc-casperlabs Mar 19, 2024
e48a51b
Warn when failing to select mixed target for gossiping
marc-casperlabs Mar 19, 2024
f26ed46
Make mixed-mode gossip configurable
marc-casperlabs Mar 19, 2024
891bb11
Update `CHANGELOG.md` to include mixed-mode gossip
marc-casperlabs Mar 19, 2024
7bc289a
Clarify match branch
marc-casperlabs Mar 19, 2024
88359c4
Fix typo in error message
marc-casperlabs Mar 19, 2024
8e77b4c
No need to use a `HashSet` when returning gossiped-to node IDs
marc-casperlabs Mar 19, 2024
982884a
Add `DeprecatedMetric`
marc-casperlabs Mar 19, 2024
4abaed5
Deprecate all metrics no longer in use in networking
marc-casperlabs Mar 19, 2024
2b4eb8a
Mention deprecated metrics in `CHANGELOG.md`
marc-casperlabs Mar 20, 2024
2f83a33
"Simplify" `ValidatorBoundComponent<REv> for Network<P>`
marc-casperlabs Mar 20, 2024
768e01a
Cleanup existing metrics docs before adding `net_gossip_requests`
marc-casperlabs Mar 21, 2024
6c49a9d
Add metrics for tracking memory overflow in metrics
marc-casperlabs Mar 21, 2024
4a5ecf0
Add per-channel metrics
marc-casperlabs Mar 21, 2024
828cef2
Add initialization code for channel metrics
marc-casperlabs Mar 21, 2024
3aa22ee
Reduce repetition in `PerChannel` type through reuse of `try_init_with`
marc-casperlabs Mar 21, 2024
3610b86
Mention per-channel metrics in `CHANGELOG`
marc-casperlabs Mar 21, 2024
28d9875
Fix clippy issues
marc-casperlabs Mar 25, 2024
ca82a43
Merge branch 'gossip-peer-selection' into metrics-overhaul
marc-casperlabs Mar 25, 2024
a71b8a7
Create metrics labels using `Opts` instead of concatenating strings
marc-casperlabs Mar 25, 2024
53b188a
Rate limit "global state sync is processing another request" warning
marc-casperlabs Mar 27, 2024
53b3e7f
Demote block acquisition notices from `info!` to `debug!`
marc-casperlabs Mar 27, 2024
4e4dd5a
Add test for `rate_limited`
marc-casperlabs Mar 27, 2024
4b70c55
Make rate limiting actuall drop semaphore tickets (and thus work)
marc-casperlabs Mar 27, 2024
14f959c
Refactor `RateLimited` slightly to move crucial logic into DRY method
marc-casperlabs Mar 27, 2024
2403316
Add test checking drop counts are correct
marc-casperlabs Mar 27, 2024
b3769bd
Fix issue where rate limiting would double the refresh interval unint…
marc-casperlabs Mar 28, 2024
a0bea7e
Merge branch 'fix-rate-limiting-issues' into feat-1.6
marc-casperlabs Mar 28, 2024
a525e54
Merge branch 'feat-1.6' into gossip-peer-selection
marc-casperlabs Mar 28, 2024
1b24fd3
Merge branch 'gossip-peer-selection' into metrics-overhaul
marc-casperlabs Mar 28, 2024
4258b52
Correctly use era validators again when broadcasting in specific era
marc-casperlabs Apr 8, 2024
21eb439
Merge pull request #4615 from marc-casperlabs/gossip-peer-selection
marc-casperlabs Apr 10, 2024
f09efa9
Merge pull request #4634 from marc-casperlabs/4505-reduce-warnings-fr…
marc-casperlabs Apr 10, 2024
a22fea6
Merge pull request #4623 from marc-casperlabs/metrics-overhaul
marc-casperlabs Apr 10, 2024
a05bdcd
Adjust testing banning and conman timeouts to make `run_equivocator_n…
marc-casperlabs Apr 10, 2024
19e6008
Fix issues with non-intentional doctests causing test failures
marc-casperlabs Apr 10, 2024
13efb71
Update `h2` to solve audit issue
marc-casperlabs Apr 10, 2024
77cfce2
Merge remote-tracking branch 'upstream/dev' into feat-1.6
marc-casperlabs Apr 11, 2024
d847f37
Reflect recent changes to defaults in production chainspec
marc-casperlabs Apr 11, 2024
277caee
Merge pull request #4660 from marc-casperlabs/chainspec-cost-update
marc-casperlabs Apr 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
419 changes: 223 additions & 196 deletions Cargo.lock

Large diffs are not rendered by default.

16 changes: 11 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@ members = [
"execution_engine_testing/tests",
"hashing",
"json_rpc",
"juliet",
"node",
"smart_contracts/contract",
"smart_contracts/contracts/[!.]*/*",
"types",
"utils/global-state-update-gen",
"utils/validation",
]
# Ensures we do not pull in all the features of dev dependencies when building.
resolver = "2"

default-members = [
"ci/casper_updater",
Expand All @@ -21,6 +24,7 @@ default-members = [
"execution_engine_testing/tests",
"hashing",
"json_rpc",
"juliet",
"node",
"types",
"utils/global-state-update-gen",
Expand All @@ -29,15 +33,17 @@ default-members = [

exclude = ["utils/nctl/remotes/casper-client-rs"]

# Include debug symbols in the release build of `casper-engine-tests` so that `simple-transfer` will yield useful
# perf data.
[profile.release.package.casper-engine-tests]
debug = true

[profile.release]
codegen-units = 1
lto = true

[profile.bench]
codegen-units = 1
lto = true

[profile.release-with-debug]
inherits = "release"
debug = true

[patch.crates-io]
datasize = { git = "https://github.com/casperlabs/datasize-rs", rev = "2b980c05af5553522dde5f2751e5a0fd3347d881" }
marc-casperlabs marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ RUST_LOG=info cargo run --release -- validator resources/local/config.toml

If the environment variable is unset, it is equivalent to setting `RUST_LOG=error`.

When developing and running unit tests, setting `NODE_TEST_LOG=json` will cause the log messages produced by the tests to be JSON-formatted.

### Log message format

A typical log message will look like:
Expand Down
6 changes: 3 additions & 3 deletions execution_engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ base16 = "0.2.1"
bincode = "1.3.1"
casper-hashing = { version = "2.0.0", path = "../hashing" }
casper-types = { version = "3.0.0", path = "../types", default-features = false, features = ["datasize", "gens", "json-schema"] }
casper-wasm-utils = "1.0.0"
casper-wasm-utils = "2.0.0"
datasize = "0.2.4"
either = "1.8.1"
hex_fmt = "0.3.0"
Expand All @@ -34,7 +34,7 @@ num-rational = { version = "0.4.0", features = ["serde"] }
num-traits = "0.2.10"
num_cpus = "1"
once_cell = "1.5.2"
parity-wasm = { version = "0.42", default-features = false }
parity-wasm = { version = "0.45.0", default-features = false }
proptest = { version = "1.0.0", optional = true }
rand = "0.8.3"
rand_chacha = "0.3.0"
Expand All @@ -47,7 +47,7 @@ thiserror = "1.0.18"
tracing = "0.1.18"
uint = "0.9.0"
uuid = { version = "0.8.1", features = ["serde", "v4"] }
wasmi = "0.9.1"
wasmi = "0.13.2"

[dev-dependencies]
assert_matches = "1.3.0"
Expand Down
16 changes: 8 additions & 8 deletions execution_engine/benches/trie_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,19 @@ fn deserialize_trie_node(b: &mut Bencher) {
}

fn serialize_trie_node_pointer(b: &mut Bencher) {
let node = Trie::<Key, StoredValue>::Extension {
affix: (0..255).collect(),
pointer: Pointer::NodePointer(Digest::hash([0; 32])),
};
let node = Trie::<Key, StoredValue>::extension(
(0..255).collect(),
Pointer::NodePointer(Digest::hash([0; 32])),
);

b.iter(|| ToBytes::to_bytes(black_box(&node)));
}

fn deserialize_trie_node_pointer(b: &mut Bencher) {
let node = Trie::<Key, StoredValue>::Extension {
affix: (0..255).collect(),
pointer: Pointer::NodePointer(Digest::hash([0; 32])),
};
let node = Trie::<Key, StoredValue>::extension(
(0..255).collect(),
Pointer::NodePointer(Digest::hash([0; 32])),
);
let node_bytes = node.to_bytes().unwrap();

b.iter(|| Trie::<Key, StoredValue>::from_bytes(black_box(&node_bytes)));
Expand Down
7 changes: 1 addition & 6 deletions execution_engine/src/core/engine_state/engine_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,8 @@ pub const DEFAULT_MAX_STORED_VALUE_SIZE: u32 = 8 * 1024 * 1024;
pub const DEFAULT_MINIMUM_DELEGATION_AMOUNT: u64 = 500 * 1_000_000_000;
/// Default value for strict argument checking.
pub const DEFAULT_STRICT_ARGUMENT_CHECKING: bool = false;
/// 91 days / 7 days in a week = 13 weeks
/// Length of total vesting schedule in days.
const VESTING_SCHEDULE_LENGTH_DAYS: usize = 91;
const DAY_MILLIS: usize = 24 * 60 * 60 * 1000;
/// Default length of total vesting schedule period expressed in days.
pub const DEFAULT_VESTING_SCHEDULE_LENGTH_MILLIS: u64 =
VESTING_SCHEDULE_LENGTH_DAYS as u64 * DAY_MILLIS as u64;
pub const DEFAULT_VESTING_SCHEDULE_LENGTH_MILLIS: u64 = 0;
/// Default value for allowing auction bids.
pub const DEFAULT_ALLOW_AUCTION_BIDS: bool = true;
/// Default value for allowing unrestricted transfers.
Expand Down
1 change: 1 addition & 0 deletions execution_engine/src/core/engine_state/execution_effect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ impl From<ExecutionJournal> for ExecutionEffect {
| Transform::AddUInt256(_)
| Transform::AddUInt512(_)
| Transform::AddKeys(_) => ops.insert_add(key, Op::Add),
Transform::Prune => ops.insert_add(key, Op::Prune),
};
transforms.insert_add(key, transform);
}
Expand Down
11 changes: 8 additions & 3 deletions execution_engine/src/core/engine_state/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ where

match self
.state
.delete_keys(correlation_id, state_root_hash, keys_to_delete)
.prune_keys(correlation_id, state_root_hash, keys_to_delete)
{
Ok(DeleteResult::Deleted(post_state_hash)) => {
Ok(PruneResult::Success { post_state_hash })
Expand Down Expand Up @@ -2342,12 +2342,12 @@ where
(delay, era_id)
};

for key in withdraw_keys {
for key in &withdraw_keys {
// Transform only those withdraw purses that are still to be
// processed in the unbonding queue.
let withdraw_purses = tracking_copy
.borrow_mut()
.read(correlation_id, &key)
.read(correlation_id, key)
.map_err(|_| Error::FailedToGetWithdrawKeys)?
.ok_or(Error::FailedToGetStoredWithdraws)?
.as_withdraw()
Expand Down Expand Up @@ -2382,6 +2382,11 @@ where
}
}

// Post-migration clean up

for withdraw_key in withdraw_keys {
tracking_copy.borrow_mut().prune(withdraw_key);
}
Ok(())
}

Expand Down
12 changes: 5 additions & 7 deletions execution_engine/src/core/engine_state/op.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,18 @@ use std::{
};

/// Representation of a single operation during execution.
#[derive(PartialEq, Eq, Debug, Clone, Copy)]
#[derive(PartialEq, Eq, Debug, Clone, Copy, Default)]
pub enum Op {
/// Read value from a `Key`.
Read,
/// Write value under a `Key`.
Write,
/// Add a value into a `Key`.
Add,
/// Prune a value under a `Key`.
Prune,
/// No operation.
#[default]
NoOp,
}

Expand Down Expand Up @@ -44,19 +47,14 @@ impl Display for Op {
}
}

impl Default for Op {
fn default() -> Self {
Op::NoOp
}
}

impl From<&Op> for casper_types::OpKind {
fn from(op: &Op) -> Self {
match op {
Op::Read => casper_types::OpKind::Read,
Op::Write => casper_types::OpKind::Write,
Op::Add => casper_types::OpKind::Add,
Op::NoOp => casper_types::OpKind::NoOp,
Op::Prune => casper_types::OpKind::Delete,
}
}
}
Loading