-
Notifications
You must be signed in to change notification settings - Fork 996
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the equivocating indices in the store
Since we sometimes reuse the slashed validator index, we need to remove it from the list of equivocating indices in the fork-choice store.
- Loading branch information
Showing
2 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
EIP-6914 -- The Beacon Chain | ||
# EIP-6914 -- The Beacon Chain | ||
|
||
## Table of contents | ||
|
||
|
This file contains 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,36 @@ | ||
# EIP-6914 -- Fork Choice | ||
|
||
## Table of contents | ||
|
||
<!-- TOC --> | ||
<!-- START doctoc generated TOC please keep comment here to allow auto update --> | ||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> | ||
|
||
- [Introduction](#introduction) | ||
- [Fork choice](#fork-choice) | ||
- [Handlers](#handlers) | ||
- [`on_reused_index`](#on_reused_index) | ||
|
||
<!-- END doctoc generated TOC please keep comment here to allow auto update --> | ||
<!-- /TOC --> | ||
|
||
## Introduction | ||
|
||
This is the modification of the fork choice according to EIP-6914. | ||
|
||
## Fork choice | ||
|
||
A new handler is added with this upgrade: | ||
|
||
- `on_reused_index(store, index)` whenever a validator index `index: ValidatorIndex` is reused | ||
|
||
This new is used to update the list of equivocating indices to be synchronized with the canonical chain. | ||
|
||
### Handlers | ||
|
||
#### `on_reused_index` | ||
|
||
```python | ||
def on_reused_index(store: Store, index: ValidatorIndex) -> None: | ||
store.equivocating_indices.discard(index) | ||
``` |