Emilia Hane
615402abcf
fixup! Fix conflicts rebasing eip4844
2023-02-10 15:35:00 +01:00
Emilia Hane
db36eb978b
Fix latest clippy lints
2023-02-10 15:35:00 +01:00
Emilia Hane
2653f88b5f
Fix conflicts rebasing eip4844
2023-02-10 15:35:00 +01:00
Emilia Hane
43bf908e7a
Fix release tests
2023-02-10 15:34:59 +01:00
Emilia Hane
4d3ff347a3
Fixes after rebasing eip4844
2023-02-10 15:34:58 +01:00
Emilia Hane
5437dcae9c
Fix conflicts rebasing eip4844
2023-02-10 15:34:58 +01:00
Emilia Hane
7545ae9e9b
fixup! Fix block lookup debug tests
2023-02-10 15:34:46 +01:00
Emilia Hane
6beca6defc
Fix range sync tests
2023-02-10 09:41:24 +01:00
Emilia Hane
e9e198a2b6
Fix conflicts rebasing eip4844
2023-02-10 09:41:23 +01:00
Emilia Hane
d292a3a6a8
Fix conflicts rebasing eip4844
2023-02-10 09:41:23 +01:00
Emilia Hane
994990063a
Fix weak_subjectivity_sync test
2023-02-10 09:41:23 +01:00
Emilia Hane
09370e70d9
Fix rebase conflicts
2023-02-10 09:41:19 +01:00
Emilia Hane
8365d76277
fixup! Debug tests
2023-02-10 09:39:22 +01:00
Emilia Hane
16cb9cfca2
fixup! Debug tests
2023-02-10 09:39:22 +01:00
Emilia Hane
7220f35ff6
Debug tests
2023-02-10 09:39:21 +01:00
Emilia Hane
995b2715f2
Fix network block_lookups test
2023-02-10 09:39:21 +01:00
Emilia Hane
3676ce78b5
Fix rebase conflicts
2023-02-10 09:39:21 +01:00
Michael Sproul
c9354a9d25
Tweaks to reward APIs ( #3957 )
...
## Proposed Changes
* Return the effective balance in gwei to align with the spec ([ideal attestation rewards](https://ethereum.github.io/beacon-APIs/?urls.primaryName=dev#/Rewards/getAttestationsRewards )).
* Use quoted `i64`s for attestation and sync committee rewards.
2023-02-10 06:19:42 +00:00
Paul Hauner
5276dd0cb0
Fix edge-case when finding the finalized descendant ( #3924 )
...
## Issue Addressed
NA
## Description
We were missing an edge case when checking to see if a block is a descendant of the finalized checkpoint. This edge case is described for one of the tests in this PR:
a119edc739/consensus/proto_array/src/proto_array_fork_choice.rs (L1018-L1047)
This bug presented itself in the following mainnet log:
```
Jan 26 15:12:42.841 ERRO Unable to validate attestation error: MissingBeaconState(0x7c30cb80ec3d4ec624133abfa70e4c6cfecfca456bfbbbff3393e14e5b20bf25), peer_id: 16Uiu2HAm8RPRciXJYtYc5c3qtCRdrZwkHn2BXN3XP1nSi1gxHYit, type: "unaggregated", slot: Slot(5660161), beacon_block_root: 0x4a45e59da7cb9487f4836c83bdd1b741b4f31c67010c7ae343fa6771b3330489
```
Here the BN is rejecting an attestation because of a "missing beacon state". Whilst it was correct to reject the attestation, it should have rejected it because it attests to a block that conflicts with finality rather than claiming that the database is inconsistent.
The block that this attestation points to (`0x4a45`) is block `C` in the above diagram. It is a non-canonical block in the first slot of an epoch that conflicts with the finalized checkpoint. Due to our lazy pruning of proto array, `0x4a45` was still present in proto-array. Our missed edge-case in [`ForkChoice::is_descendant_of_finalized`](38514c07f2/consensus/fork_choice/src/fork_choice.rs (L1375-L1379)
) would have indicated to us that the block is a descendant of the finalized block. Therefore, we would have accepted the attestation thinking that it attests to a descendant of the finalized *checkpoint*.
Since we didn't have the shuffling for this erroneously processed block, we attempted to read its state from the database. This failed because we prune states from the database by keeping track of the tips of the chain and iterating back until we find a finalized block. This would have deleted `C` from the database, hence the `MissingBeaconState` error.
2023-02-09 23:51:18 +00:00
Emilia Hane
6a37e84399
fixup! Fix regression in DB write atomicity
2023-02-08 11:44:46 +01:00
Emilia Hane
bc468b4ce5
fixup! Improve use of whitespace
2023-02-08 11:44:45 +01:00
Michael Sproul
ac4b5b580c
Fix regression in DB write atomicity
2023-02-08 11:44:45 +01:00
Emilia Hane
9d919917f5
Removed unused code
2023-02-08 11:44:45 +01:00
Emilia Hane
d7eb9441cf
Reorder loading of db metadata from disk to allow for future changes to schema
2023-02-08 11:44:45 +01:00
Emilia Hane
d599e41f3d
Remove debug comment
...
Co-authored-by: Michael Sproul <micsproul@gmail.com>
2023-02-08 11:44:44 +01:00
Emilia Hane
577262ccbf
Improve use of whitespace
...
Co-authored-by: Michael Sproul <micsproul@gmail.com>
2023-02-08 11:44:44 +01:00
Emilia Hane
56c84178f2
Fix conflicts rebasing eip4844
2023-02-08 11:44:44 +01:00
Emilia Hane
b2abec5d35
Verify StoreConfig
2023-02-08 11:44:44 +01:00
Emilia Hane
00ca21e84c
Make implementation of BlobInfo more coder friendly
2023-02-08 11:44:43 +01:00
Emilia Hane
8f137df02e
fixup! Allow user to set an epoch margin for pruning
2023-02-08 11:44:43 +01:00
Emilia Hane
a2eda76291
Correct comment
2023-02-08 11:44:43 +01:00
Emilia Hane
9ee9b6df76
Remove unused stuff
2023-02-08 11:44:42 +01:00
Emilia Hane
6dff69bde9
Atomically update blob info with pruned blobs
2023-02-08 11:44:42 +01:00
Emilia Hane
5d2480c762
Improve naming
2023-02-08 11:44:42 +01:00
Emilia Hane
9c2e623555
Reflect use of prune margin epochs at import
2023-02-08 11:44:42 +01:00
Emilia Hane
d4795601f2
fixup! Prune from highest data availability boundary
2023-02-08 11:44:41 +01:00
Emilia Hane
43c3c74a48
fixup! Fix blobs store bug
2023-02-08 11:44:41 +01:00
Emilia Hane
63ca3bfb29
Prune from highest data availability boundary
2023-02-08 11:44:41 +01:00
Emilia Hane
c50f83116e
Fix wording
...
Co-authored-by: Michael Sproul <micsproul@gmail.com>
2023-02-08 11:44:41 +01:00
Emilia Hane
f6346f89c1
Clarify comment
...
Co-authored-by: Michael Sproul <micsproul@gmail.com>
2023-02-08 11:44:41 +01:00
Emilia Hane
e4b447395a
Clarify wording
...
Co-authored-by: Michael Sproul <micsproul@gmail.com>
2023-02-08 11:44:40 +01:00
Emilia Hane
756c881857
Keep uniform size small keys
...
Co-authored-by: Michael Sproul <micsproul@gmail.com>
2023-02-08 11:44:40 +01:00
Emilia Hane
4de523fb75
fixup! Allow user to set an epoch margin for pruning
2023-02-08 11:44:40 +01:00
Emilia Hane
1812301c9c
Allow user to set an epoch margin for pruning
2023-02-08 11:44:40 +01:00
Emilia Hane
d7fc24a9d5
Plug in running blob pruning in migrator, related bug fixes and add todos
2023-02-08 11:44:40 +01:00
Emilia Hane
0bdc291490
Only store non-empty orphaned blobs
2023-02-08 11:44:39 +01:00
Emilia Hane
caa04db58a
Run prune blobs on migrator thread
2023-02-08 11:44:39 +01:00
Emilia Hane
a875bec5f2
Fix blobs store bug
2023-02-08 11:44:39 +01:00
Emilia Hane
3bede06c9b
Fix typo
2023-02-08 11:44:38 +01:00
Emilia Hane
54699f808c
fixup! Clarify hybrid blob prune solution and fix error handling
2023-02-08 11:44:38 +01:00
Emilia Hane
83a9520761
Clarify hybrid blob prune solution and fix error handling
2023-02-08 11:44:38 +01:00
Emilia Hane
3d93dad0e2
Fix type bug
...
Co-authored-by: realbigsean <seananderson33@GMAIL.com>
2023-02-08 11:44:37 +01:00
Emilia Hane
44ec331452
fixup! Simplify conceptual design
2023-02-08 11:44:37 +01:00
Emilia Hane
20567750c1
fixup! Simplify conceptual design
2023-02-08 11:44:37 +01:00
Emilia Hane
7103a257ce
Simplify conceptual design
2023-02-08 11:44:37 +01:00
Emilia Hane
0d13932663
Fix epoch constructor misconception
2023-02-08 11:44:37 +01:00
Emilia Hane
b5abfe620a
Convert epochs_per_blob_prune to Epoch once
2023-02-08 11:44:36 +01:00
Emilia Hane
fb2ce909f6
Avoid repeteadly updating blob info for multiple head candidates
2023-02-08 11:44:36 +01:00
Emilia Hane
d58a30b3de
fixup! Store orphan block roots
2023-02-08 11:44:36 +01:00
Emilia Hane
6346c30158
Enable skipping blob pruning at each epoch
2023-02-08 11:44:35 +01:00
Emilia Hane
2f565d25b2
Prune blobs in bg after canonical head update
2023-02-08 11:44:35 +01:00
Emilia Hane
8752deeced
Store orphan block roots
2023-02-08 11:44:35 +01:00
Emilia Hane
c7f53a9062
Delete blobs that conflict with finalization
2023-02-08 11:44:34 +01:00
Emilia Hane
94aa2cef67
Log info loaded from disk
2023-02-08 11:44:34 +01:00
Emilia Hane
a2b8c6ee69
Save fetching state for blobs pruning
2023-02-08 11:44:33 +01:00
Emilia Hane
6f5ca02ac9
Improve syntax
...
Co-authored-by: Michael Sproul <micsproul@gmail.com>
2023-02-08 11:44:33 +01:00
Emilia Hane
667cca5cf2
Fix try_prune_blobs to use state root
2023-02-08 11:44:33 +01:00
Emilia Hane
d67468d737
Prune blobs on migration in addition to start-up
2023-02-08 11:44:32 +01:00
Emilia Hane
ce2db355de
Fix rebase conflict
2023-02-08 11:44:32 +01:00
Emilia Hane
a211e6afee
Fix rebase conflict
2023-02-08 11:44:31 +01:00
Emilia Hane
28e1e635c3
Fix rebase conflict
2023-02-08 11:44:31 +01:00
Emilia Hane
d3b94d8617
fixup! Prune blobs before data availability breakpoint
2023-02-08 11:44:31 +01:00
Emilia Hane
934f3ab587
Remove inaccurate guess for db index
2023-02-08 11:44:31 +01:00
Emilia Hane
d21c66ddf4
fixup! Plug in pruning of blobs into app
2023-02-08 11:44:31 +01:00
Emilia Hane
b88d888145
fixup! Plug in pruning of blobs into app
2023-02-08 11:44:30 +01:00
Emilia Hane
2a41f25d68
fixup! Prune blobs before data availability breakpoint
2023-02-08 11:44:30 +01:00
Emilia Hane
fe0c911402
Plug in pruning of blobs into app
2023-02-08 11:44:30 +01:00
Emilia Hane
7bf88c2336
Prune blobs before data availability breakpoint
2023-02-08 11:44:30 +01:00
Emilia Hane
e2a6da4274
Boiler plate code for blobs pruning
2023-02-08 11:44:20 +01:00
Divma
ceb986549d
Self rate limiting dev flag ( #3928 )
...
## Issue Addressed
Adds self rate limiting options, mainly with the idea to comply with peer's rate limits in small testnets
## Proposed Changes
Add a hidden flag `self-limiter` this can take no value, or customs values to configure quotas per protocol
## Additional Info
### How to use
`--self-limiter` will turn on the self rate limiter applying the same params we apply to inbound requests (requests from other peers)
`--self-limiter "beacon_blocks_by_range:64/1"` will turn on the self rate limiter for ALL protocols, but change the quota for bbrange to 64 requested blocks per 1 second.
`--self-limiter "beacon_blocks_by_range:64/1;ping:1/10"` same as previous one, changing the quota for ping as well.
### Caveats
- The rate limiter is either on or off for all protocols. I added the custom values to be able to change the quotas per protocol so that some protocols can be given extremely loose or tight quotas. I think this should satisfy every need even if we can't technically turn off rate limits per protocol.
- This reuses the rate limiter struct for the inbound requests so there is this ugly part of the code in which we need to deal with the inbound only protocols (light client stuff) if this becomes too ugly as we add lc protocols, we might want to split the rate limiters. I've checked this and looks doable with const generics to avoid so much code duplication
### Knowing if this is on
```
Feb 06 21:12:05.493 DEBG Using self rate limiting params config: OutboundRateLimiterConfig { ping: 2/10s, metadata: 1/15s, status: 5/15s, goodbye: 1/10s, blocks_by_range: 1024/10s, blocks_by_root: 128/10s }, service: libp2p_rpc, service: libp2p
```
2023-02-08 02:18:53 +00:00
Diva M
493784366f
self rate limiting
2023-02-07 13:00:35 -05:00
realbigsean
a42d07592c
fix compilation issues after merge
2023-02-07 12:33:29 -05:00
realbigsean
26a296246d
Merge branch 'capella' of https://github.com/sigp/lighthouse into eip4844
...
# Conflicts:
# beacon_node/beacon_chain/src/beacon_chain.rs
# beacon_node/beacon_chain/src/block_verification.rs
# beacon_node/beacon_chain/src/test_utils.rs
# beacon_node/execution_layer/src/engine_api.rs
# beacon_node/execution_layer/src/engine_api/http.rs
# beacon_node/execution_layer/src/lib.rs
# beacon_node/execution_layer/src/test_utils/handle_rpc.rs
# beacon_node/http_api/src/lib.rs
# beacon_node/http_api/tests/fork_tests.rs
# beacon_node/network/src/beacon_processor/mod.rs
# beacon_node/network/src/beacon_processor/work_reprocessing_queue.rs
# beacon_node/network/src/beacon_processor/worker/sync_methods.rs
# beacon_node/operation_pool/src/bls_to_execution_changes.rs
# beacon_node/operation_pool/src/lib.rs
# beacon_node/operation_pool/src/persistence.rs
# consensus/serde_utils/src/u256_hex_be_opt.rs
# testing/antithesis/Dockerfile.libvoidstar
2023-02-07 12:12:56 -05:00
realbigsean
3533ed418e
pr feedback and bugfixes
2023-02-07 08:36:35 -05:00
naviechan
9547ac069c
Implement block_rewards API (per-validator reward) ( #3907 )
...
## Issue Addressed
[#3661 ](https://github.com/sigp/lighthouse/issues/3661 )
## Proposed Changes
`/eth/v1/beacon/rewards/blocks/{block_id}`
```
{
"execution_optimistic": false,
"finalized": false,
"data": {
"proposer_index": "123",
"total": "123",
"attestations": "123",
"sync_aggregate": "123",
"proposer_slashings": "123",
"attester_slashings": "123"
}
}
```
The issue contains the implementation of three per-validator reward APIs:
* `sync_committee_rewards`
* [`attestation_rewards`](https://github.com/sigp/lighthouse/pull/3822 )
* `block_rewards`
This PR only implements the `block_rewards`.
The endpoints can be viewed in the Ethereum Beacon nodes API browser: [https://ethereum.github.io/beacon-APIs/?urls.primaryName=dev#/Rewards ](https://ethereum.github.io/beacon-APIs/?urls.primaryName=dev#/Rewards )
## Additional Info
The implementation of [consensus client reward APIs](https://github.com/eth-protocol-fellows/cohort-three/blob/master/projects/project-ideas.md#consensus-client-reward-apis ) is part of the [EPF](https://github.com/eth-protocol-fellows/cohort-three ).
Co-authored-by: kevinbogner <kevbogner@gmail.com>
Co-authored-by: navie <naviechan@gmail.com>
2023-02-07 08:33:23 +00:00
Paul Hauner
e062a7cf76
Broadcast address changes at Capella ( #3919 )
...
* Add first efforts at broadcast
* Tidy
* Move broadcast code to client
* Progress with broadcast impl
* Rename to address change
* Fix compile errors
* Use `while` loop
* Tidy
* Flip broadcast condition
* Switch to forgetting individual indices
* Always broadcast when the node starts
* Refactor into two functions
* Add testing
* Add another test
* Tidy, add more testing
* Tidy
* Add test, rename enum
* Rename enum again
* Tidy
* Break loop early
* Add V15 schema migration
* Bump schema version
* Progress with migration
* Update beacon_node/client/src/address_change_broadcast.rs
Co-authored-by: Michael Sproul <micsproul@gmail.com>
* Fix typo in function name
---------
Co-authored-by: Michael Sproul <micsproul@gmail.com>
2023-02-07 17:13:49 +11:00
kevinbogner
4d07e40501
Implement attestation_rewards
API (per-validator reward) ( #3822 )
...
## Issue Addressed
#3661
## Proposed Changes
`/eth/v1/beacon/rewards/attestations/{epoch}`
```json
{
"execution_optimistic": false,
"finalized": false,
"data": [
{
"ideal_rewards": [
{
"effective_balance": "1000000000",
"head": "2500",
"target": "5000",
"source": "5000"
}
],
"total_rewards": [
{
"validator_index": "0",
"head": "2000",
"target": "2000",
"source": "4000",
"inclusion_delay": "2000"
}
]
}
]
}
```
The issue contains the implementation of three per-validator reward APIs:
- [`sync_committee_rewards`](https://github.com/sigp/lighthouse/pull/3790 )
- `attestation_rewards`
- `block_rewards`.
This PR *only* implements the `attestation_rewards`.
The endpoints can be viewed in the Ethereum Beacon nodes API browser: https://ethereum.github.io/beacon-APIs/?urls.primaryName=dev#/Rewards
## Additional Info
The implementation of [consensus client reward APIs](https://github.com/eth-protocol-fellows/cohort-three/blob/master/projects/project-ideas.md#consensus-client-reward-apis ) is part of the [EPF](https://github.com/eth-protocol-fellows/cohort-three ).
---
- [x] `get_state`
- [x] Calculate *ideal rewards* with some logic from `get_flag_index_deltas`
- [x] Calculate *actual rewards* with some logic from `get_flag_index_deltas`
- [x] Code cleanup
- [x] Testing
2023-02-07 00:00:19 +00:00
ethDreamer
5b398b1990
Don't Reject all Builder Bids After Capella ( #3940 )
...
* Fix bug in Builder API Post-Capella
* Fix Clippy Complaints
2023-02-06 13:09:13 +11:00
sean
e5896d9b71
re-order methods
2023-02-05 18:14:24 -05:00
sean
1315098c15
variable list from -> new
2023-02-05 17:56:03 -05:00
sean
38db8d7952
add back in 4844 tx consistencycheck during payload reconstruction
2023-02-05 17:31:20 -05:00
sean
f22aac1603
improve error handling
2023-02-05 17:26:36 -05:00
sean
90e25dc6cf
from to new
2023-02-05 16:55:55 -05:00
sean
94a369b9df
blob tx decoding
2023-02-05 16:39:15 -05:00
realbigsean
d9e83e6cec
blob decoding
2023-02-03 17:06:33 -05:00
ethDreamer
90b6ae62e6
Use Local Payload if More Profitable than Builder ( #3934 )
...
* Use Local Payload if More Profitable than Builder
* Rename clone -> clone_from_ref
* Minimize Clones of GetPayloadResponse
* Cleanup & Fix Tests
* Added Tests for Payload Choice by Profit
* Fix Outdated Comments
2023-02-01 19:37:46 -06:00
Mark Mackey
d842215a44
Merge branch 'upstream/unstable' into capella
2023-01-31 12:16:26 -06:00
ethDreamer
7b7595347d
exchangeCapabilities & Capella Readiness Logging ( #3918 )
...
* Undo Passing Spec to Engine API
* Utilize engine_exchangeCapabilities
* Add Logging to Indicate Capella Readiness
* Add exchangeCapabilities to mock_execution_layer
* Send Nested Array for engine_exchangeCapabilities
* Use Mutex Instead of RwLock for EngineCapabilities
* Improve Locking to Avoid Deadlock
* Prettier logic for get_engine_capabilities
* Improve Comments
* Update beacon_node/beacon_chain/src/capella_readiness.rs
Co-authored-by: Michael Sproul <micsproul@gmail.com>
* Update beacon_node/beacon_chain/src/capella_readiness.rs
Co-authored-by: Michael Sproul <micsproul@gmail.com>
* Update beacon_node/beacon_chain/src/capella_readiness.rs
Co-authored-by: Michael Sproul <micsproul@gmail.com>
* Update beacon_node/beacon_chain/src/capella_readiness.rs
Co-authored-by: Michael Sproul <micsproul@gmail.com>
* Update beacon_node/beacon_chain/src/capella_readiness.rs
Co-authored-by: Michael Sproul <micsproul@gmail.com>
* Update beacon_node/client/src/notifier.rs
Co-authored-by: Michael Sproul <micsproul@gmail.com>
* Update beacon_node/execution_layer/src/engine_api/http.rs
Co-authored-by: Michael Sproul <micsproul@gmail.com>
* Addressed Michael's Comments
---------
Co-authored-by: Michael Sproul <micsproul@gmail.com>
2023-01-31 18:26:23 +01:00
realbigsean
6d2dff66a0
Merge pull request #3926 from divagant-martian/stream-timeout-blob-bug
...
send stream terminators
2023-01-27 19:05:04 +01:00
realbigsean
b7e20fb87a
Update beacon_node/lighthouse_network/src/rpc/protocol.rs
2023-01-27 19:03:43 +01:00