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

Refactor: validator state to support multiple states #148

Merged
merged 51 commits into from
Oct 19, 2023
Merged
Changes from 1 commit
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
dd47f56
Refactor: validator state to support multiple states
maurolacy Oct 12, 2023
2e2ee88
Rename to tombstone_validator for clarity
maurolacy Oct 12, 2023
4d7fe11
Refactor: Single ValsetUpdate IBC packet
maurolacy Oct 13, 2023
0d5d801
Fix / adapt tests
maurolacy Oct 13, 2023
c64cac6
Refactor: Send a single IBC packet per valset update event
maurolacy Oct 13, 2023
d5da7f2
Send all of the valset updates to the Provider
maurolacy Oct 13, 2023
c0449b1
Process valset updates at the end (for status updates)
maurolacy Oct 13, 2023
b328951
Add vs update behaviour
maurolacy Oct 13, 2023
8895f19
Add remove validator
maurolacy Oct 13, 2023
da647f6
Add jail validator
maurolacy Oct 13, 2023
88f9883
Add unjail validator
maurolacy Oct 13, 2023
b576dd6
Add FIXME
maurolacy Oct 13, 2023
772e361
Fix: Add existing validator sets it to active, updates pubkey
maurolacy Oct 13, 2023
5bee17b
Add remove / add existing test
maurolacy Oct 14, 2023
0bfecd5
Add jail / unjail / remove tests
maurolacy Oct 14, 2023
ce33570
Add after tombstoning test
maurolacy Oct 14, 2023
978e1c9
Use try_fold instead of fold
maurolacy Oct 14, 2023
d7b83f6
Fix: Drain newer events during tombtoning
maurolacy Oct 14, 2023
358a01a
Refactor valset update into external staking contract
maurolacy Oct 16, 2023
21da8bd
Add valset maintenance (drain older events)
maurolacy Oct 16, 2023
28ee587
Add valset update events
maurolacy Oct 16, 2023
adf33d0
Update comment
maurolacy Oct 16, 2023
cfbbe60
Fix: unjail does not depend on old state
maurolacy Oct 16, 2023
bfc722b
Fix: route all valset update events to the Provider
maurolacy Oct 16, 2023
5e60bbc
Use try_fold instead of fold
maurolacy Oct 16, 2023
3ed8a98
cargo clippy
maurolacy Oct 16, 2023
fcdda9e
Add list all validators query
maurolacy Oct 16, 2023
7a6f6df
Remove unjailing as it's a no-op atm
maurolacy Oct 16, 2023
dee9ec9
Rename list remote validators to list active validators for clarity
maurolacy Oct 16, 2023
c590b43
Expand comment on unjailing no-op
maurolacy Oct 16, 2023
ade28ea
Add list_validators to tests
maurolacy Oct 16, 2023
a454c44
Add contract unit tests setup
maurolacy Oct 17, 2023
1a67481
Fix: Avoid error when state not found
maurolacy Oct 17, 2023
aa9e01e
Add valset update happy path test
maurolacy Oct 17, 2023
1b7d8a6
Fix: Avoid error when last state not found
maurolacy Oct 17, 2023
7b48ef0
Add side effects checks
maurolacy Oct 17, 2023
fe47c2e
Add tombstoning during slashing happy path test
maurolacy Oct 18, 2023
6d318e2
Add (failing) slashing while pending bond test
maurolacy Oct 18, 2023
04858c0
Fix: Don't fail if slashing during a pending tx
maurolacy Oct 18, 2023
63e96d3
Add (failing) slashing unbonded validator test
maurolacy Oct 18, 2023
22fa6ba
Fix: Don't try to slash unbonded validators
maurolacy Oct 18, 2023
943ecd3
Add tombstoning nonexistent validator test
maurolacy Oct 18, 2023
4ab8d6b
Add slashing while pending unbond test
maurolacy Oct 18, 2023
79f9244
Add slashing during jailing test
maurolacy Oct 18, 2023
38397b4
Add validator removal test
maurolacy Oct 18, 2023
da6b8d0
Add validator unjail does nothing test
maurolacy Oct 18, 2023
f1f5d9a
Add validator update does not change state test
maurolacy Oct 18, 2023
78e53b2
Fix comments / format
maurolacy Oct 18, 2023
20c19d9
Fix: drain older events relative to current block time
maurolacy Oct 18, 2023
6a9cb91
Add drain_older tests
maurolacy Oct 18, 2023
4f4efc8
Add comment
maurolacy Oct 18, 2023
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
Prev Previous commit
Next Next commit
Add FIXME
  • Loading branch information
maurolacy committed Oct 13, 2023
commit b576dd6051977f780a2892eff63474a8950198c4
2 changes: 1 addition & 1 deletion contracts/provider/external-staking/src/crdt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ impl<'a> CrdtState<'a> {
// We just silently ignore it if already tombstoned
if !validator_state.is_tombstoned() {
let val_state = ValState {
pub_key: "TODO".to_string(),
pub_key: "".to_string(), // FIXME? Keep pubkey
start_height: height,
start_time: time,
state: State::Tombstoned {},
Expand Down