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

feat(sequencer): conditional unbonding + kick for liveness #1343

Merged
merged 289 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from 226 commits
Commits
Show all changes
289 commits
Select commit Hold shift + click to select a range
7eb9956
still working on it, ide indexing is broken
danwt Oct 24, 2024
d3d59ed
more refac
danwt Oct 24, 2024
74addb0
why the fuck does the notice queue have the whole object?
danwt Oct 24, 2024
8eaf6b2
cleaned most things
danwt Oct 24, 2024
8f591ee
trying to get building
danwt Oct 24, 2024
13d51f2
remove busted snippet
danwt Oct 24, 2024
584dac5
now need to fix queries
danwt Oct 24, 2024
78cda4e
fix queries
danwt Oct 24, 2024
88f3a56
oh my
danwt Oct 24, 2024
49ce118
more build errors
danwt Oct 24, 2024
65b8b7a
need to fix expected keeper
danwt Oct 24, 2024
eadc9af
gonna enhance try get sequencer
danwt Oct 24, 2024
451c61e
huge build fix
danwt Oct 24, 2024
491c7b5
build
danwt Oct 24, 2024
f2e8a38
more fixups, time to test this bad boi
danwt Oct 24, 2024
f958637
cleaning up errors
danwt Oct 24, 2024
1d3430c
now starting to fix up
danwt Oct 24, 2024
abd13bd
attempt to fix create sequencer test but havent run it yet
danwt Oct 24, 2024
1f92bae
trying to fix tests
danwt Oct 24, 2024
86a038d
cp
danwt Oct 24, 2024
2bede48
why is the coins api so bad
danwt Oct 24, 2024
75ac598
cp
danwt Oct 24, 2024
f3607da
working on fixing tests
danwt Oct 24, 2024
355bfc3
pre del fraud submitted test
danwt Oct 24, 2024
62cf0b8
its probably time to rethink the tests
danwt Oct 24, 2024
82fbfe8
pre slightly rework get sequencer api
danwt Oct 25, 2024
55eed47
cp
danwt Oct 25, 2024
18ed8e6
wtf
danwt Oct 25, 2024
370d71f
revert idea to simplify
danwt Oct 25, 2024
a5678b3
time to fix internal tests
danwt Oct 25, 2024
cf959a1
move some test code
danwt Oct 25, 2024
da2767f
refactor test utils
danwt Oct 25, 2024
3545fb3
lets write some tests
danwt Oct 25, 2024
142375c
pre combine bond files
danwt Oct 25, 2024
a379423
test file refac
danwt Oct 25, 2024
73dbb2c
gonna remove the setup calls
danwt Oct 25, 2024
c921354
remove test setups
danwt Oct 25, 2024
7c6b16a
why
danwt Oct 25, 2024
fb100f9
can I just delete everything
danwt Oct 25, 2024
eb0e5f5
move legacy stuff to legacy test file
danwt Oct 25, 2024
623e95d
gonna find rollapp keeper references
danwt Oct 25, 2024
fbb5e41
replace rollapp keeper references
danwt Oct 25, 2024
4716808
need to fix other builds
danwt Oct 25, 2024
fa58b55
fix one bug and confirm one test pass
danwt Oct 25, 2024
1412d58
tests make sense
danwt Oct 25, 2024
24caaca
the test works
danwt Oct 25, 2024
1a92de2
do increase bond test
danwt Oct 25, 2024
0dfd6f0
basics are done
danwt Oct 25, 2024
0b1ce42
finish the basic tests
danwt Oct 25, 2024
315e16b
basics seem to work
danwt Oct 25, 2024
8ed6d53
going to do kick test now
danwt Oct 25, 2024
78f517b
working on kick test
danwt Oct 25, 2024
adf7458
fix kick flow and test it
danwt Oct 25, 2024
a1a2826
lets try running the tests
danwt Oct 25, 2024
0904cf7
going to rename some things
danwt Oct 25, 2024
0aea268
trying to fix failure
danwt Oct 25, 2024
5aa5ee8
lets try to regen
danwt Oct 25, 2024
cebeea8
deprecate unbonding
danwt Oct 25, 2024
983fb73
remove unbonding completle
danwt Oct 25, 2024
ff3ed20
reserve
danwt Oct 25, 2024
9809801
remove references to unbonding
danwt Oct 25, 2024
c0b81a4
tests pass
danwt Oct 25, 2024
3f1bd57
adds a small test for ub blockers
danwt Oct 25, 2024
732dd89
rotation test
danwt Oct 25, 2024
587f8bc
start to write a basic rotation test
danwt Oct 25, 2024
b194966
adds a basic rotation test
danwt Oct 25, 2024
4e1f674
need to make sure successor cannot do anything after elapse
danwt Oct 25, 2024
a08e946
i would sayyyyyy
danwt Oct 25, 2024
ca1182f
cp
danwt Oct 25, 2024
363ab03
finish rotation test
danwt Oct 25, 2024
59525ae
writing the fraud test
danwt Oct 25, 2024
c90ee2a
adds a basic slash test
danwt Oct 25, 2024
4a35149
really
danwt Oct 25, 2024
a8aa9c0
get to the bottom of th ebug
danwt Oct 28, 2024
9637e13
lets make sure the opt in is sorted
danwt Oct 28, 2024
2aab07d
some file change
danwt Oct 28, 2024
d14c6a2
need to change things up a bit for the new product direction
danwt Oct 28, 2024
16b9526
need to update the fraud secnarios
danwt Oct 28, 2024
ca2e87b
pre simplify choose proposer
danwt Oct 28, 2024
3b97173
partially through opt out changes
danwt Oct 28, 2024
28fa74c
now going to change choose proposer
danwt Oct 28, 2024
2233b07
adjusted the logic
danwt Oct 28, 2024
71c5273
gonna refactor
danwt Oct 28, 2024
d9d9f2f
fix build, now going to fix tests
danwt Oct 28, 2024
ccc0272
still want the successor preference
danwt Oct 28, 2024
d2c07b6
cp
danwt Oct 28, 2024
b846627
all tests pass
danwt Oct 28, 2024
96d5a36
TestRotationProposerAndSuccessorBothUnbond is buggy
danwt Oct 28, 2024
1b3a3ae
tests seem to be all fixed
danwt Oct 28, 2024
7598f52
regen proto
danwt Oct 28, 2024
8a47f73
confirm all tests pass, now going to check the liveness slash scheduling
danwt Oct 28, 2024
4824c16
double check everything kosher with liveness slash
danwt Oct 28, 2024
55f560a
why cant it find my reference
danwt Oct 28, 2024
84b3499
confirm tests passing with hooks
danwt Oct 28, 2024
33a20e3
gonna revert liveness file changes
danwt Oct 28, 2024
eee5960
finish liveness queue fixes
danwt Oct 28, 2024
4cbb894
fixes tests
danwt Oct 28, 2024
b1b67b5
working to replace legacy tests
danwt Oct 28, 2024
97919d0
confirm tests pass
danwt Oct 28, 2024
98a3a97
start bringing back alex test
danwt Oct 28, 2024
606eac9
reworking the test a bit
danwt Oct 28, 2024
cc978ae
confirm tests still ok
danwt Oct 28, 2024
93865aa
confirm tests still ok
danwt Oct 28, 2024
f8142b0
test
danwt Oct 28, 2024
e77bc3a
pre del some old utils
danwt Oct 28, 2024
0c794e0
fix without crap
danwt Oct 28, 2024
b77c5d1
oh my
danwt Oct 28, 2024
cb29133
tuesday morn
danwt Oct 29, 2024
e23d7c0
cleanup a little bit
danwt Oct 29, 2024
296b2a4
cli
danwt Oct 29, 2024
ae95da3
ad some events
danwt Oct 29, 2024
3e0d7dc
working on slash
danwt Oct 29, 2024
e1fa49f
add another event
danwt Oct 29, 2024
2265f4e
add some new event types
danwt Oct 29, 2024
136ee3b
adds events, confirms passing
danwt Oct 29, 2024
e163c8d
add rollapp id to events
danwt Oct 29, 2024
afbf3bd
docstrings
danwt Oct 29, 2024
8dfdb40
need to read the unbond adr
danwt Oct 29, 2024
17d7d2e
pre add other bond conditions
danwt Oct 29, 2024
9cfe66e
start to do unbonding conds
danwt Oct 29, 2024
7cca3c9
lets pause for a sec
danwt Oct 29, 2024
92292d5
write most of the new logic
danwt Oct 29, 2024
c64bff6
ok, now time to change the data structures
danwt Oct 29, 2024
30151b0
define collections
danwt Oct 29, 2024
0ea3514
finish the udpate!
danwt Oct 29, 2024
9d2623a
oh my god
danwt Oct 29, 2024
ca3151c
pre refactor on update
danwt Oct 29, 2024
71f32e4
try to bring structure
danwt Oct 29, 2024
a3d7e64
finish optimistic update
danwt Oct 29, 2024
8eda88f
looks ok to me
danwt Oct 29, 2024
cbc7c90
now next phase is the state infos
danwt Oct 29, 2024
69c647c
impl the state for the rollapp keeper
danwt Oct 29, 2024
6be3f92
impl the condition for rollapp keeper
danwt Oct 29, 2024
4c80156
lfg
danwt Oct 29, 2024
d5322c7
feature complete, now need to ripout
danwt Oct 29, 2024
5f7f9f4
pre teardown
danwt Oct 29, 2024
dad94cc
PRE SLIGHTLY REWORK CANON FUNCS
danwt Oct 29, 2024
9ec7b8b
fixing build errors
danwt Oct 29, 2024
09bed10
hopefully finished most things, now probalby need to fix tests
danwt Oct 29, 2024
1bf8a9c
remove from genesis
danwt Oct 29, 2024
b9b2444
regen proto
danwt Oct 29, 2024
cb13c76
ahh time to fix tests
danwt Oct 29, 2024
08723d2
partial progress on fixing tests
danwt Oct 29, 2024
4b33256
gonna refactor the utils
danwt Oct 29, 2024
7d00f86
need to be careful about which address type is being used
danwt Oct 29, 2024
20aaa3d
change up keys
danwt Oct 29, 2024
51bd1ea
cp
danwt Oct 29, 2024
bb54272
working on keys
danwt Oct 30, 2024
ff3c12e
refactor some pub key stuff
danwt Oct 30, 2024
34cf3e0
need to fix about 1000 build errors
danwt Oct 30, 2024
f8ea2e6
need to mock this
danwt Oct 30, 2024
7db04bd
add a mock with panic
danwt Oct 30, 2024
c22c7b7
added collections stuff
danwt Oct 30, 2024
718fb9e
del GetValHashForSequencer
danwt Oct 30, 2024
12cea59
lets try to test again
danwt Oct 30, 2024
96c72c0
tests work but fail
danwt Oct 30, 2024
31a2dfa
refac
danwt Oct 30, 2024
c9e899c
what if I TRY to move the register sequencer call
danwt Oct 30, 2024
a6c44e5
partial refac of update client test
danwt Oct 30, 2024
d28c443
delete ibctesting light client test
danwt Oct 30, 2024
4d04955
need to fix the lc test
danwt Oct 30, 2024
b700fbf
why
danwt Oct 30, 2024
994e0e8
trying to setup test better
danwt Oct 30, 2024
ad89a55
test progress
danwt Oct 30, 2024
3b9bff3
i need to lift these dupe string
danwt Oct 30, 2024
44a2478
confirm the happy test works
danwt Oct 30, 2024
630d2b9
gonna delete the rest of the update test
danwt Oct 30, 2024
e37252a
remove failing test
danwt Oct 30, 2024
4466b3a
remove genesis tets
danwt Oct 30, 2024
1db01d5
tests pass
danwt Oct 30, 2024
e2a2b5c
effectively disable ante handler using enabled
danwt Oct 30, 2024
c8adfdb
fix test: not allowed - pub key in use
danwt Oct 30, 2024
ccc07e6
try to improve tests around creation
danwt Oct 30, 2024
ecb7d8f
pre move troublesome test
danwt Oct 30, 2024
fa671bb
code definitely works
danwt Oct 30, 2024
b89be8a
del all invariants
danwt Oct 30, 2024
7a8c390
rename
danwt Oct 30, 2024
ccb9480
pre merge main
danwt Oct 30, 2024
10bff29
merge with manual conflict resolution, need to do some stuff
danwt Oct 30, 2024
cfbc378
tyr to bump go.mod
danwt Oct 30, 2024
fb724c3
tidy
danwt Oct 30, 2024
e6f1160
gofump
danwt Oct 30, 2024
bd1c54a
fix a proto conflict and rebuild proto
danwt Oct 30, 2024
f5f31a5
addd bakc logic
danwt Oct 30, 2024
2affd8f
working to repair
danwt Oct 30, 2024
c74909b
still repairing
danwt Oct 30, 2024
8704792
tests pass
danwt Oct 30, 2024
cdbcacf
linter
danwt Oct 31, 2024
3b3d2d9
fix regression
danwt Oct 31, 2024
ad26007
couple docs
danwt Oct 31, 2024
7529ab7
start working on basic flow
danwt Oct 31, 2024
c40bfab
add a stub for keeper test
danwt Oct 31, 2024
7b9c786
have a q about canonical client
danwt Oct 31, 2024
bb5cfe8
need to write a prune test
danwt Oct 31, 2024
1f30d40
add light client unbond flow test
danwt Oct 31, 2024
6b6f2e8
in the middle of writing the bond condition test for block height
danwt Oct 31, 2024
11e4263
adds tests for the unbond conditions
danwt Oct 31, 2024
269dbd5
pre just change keeper to be pointer everywhere
danwt Oct 31, 2024
83f3b38
fix tests with wiring
danwt Oct 31, 2024
6fc6479
accept some code from cline
danwt Oct 31, 2024
166eab1
try to clear up cline
danwt Oct 31, 2024
fa8b086
test
danwt Oct 31, 2024
d290826
proto regen
danwt Oct 31, 2024
9999995
why
danwt Oct 31, 2024
0a9eaa1
ads validates for new sequencer messages
danwt Oct 31, 2024
a56ad62
test update opt in flow
danwt Oct 31, 2024
b63404d
before start the e2e kind of ut
danwt Oct 31, 2024
d09cb7c
bump test
danwt Oct 31, 2024
868e3ac
confirm tests passing
danwt Oct 31, 2024
92a6473
confirm tests pass
danwt Oct 31, 2024
3a21530
just going to do it myself
danwt Oct 31, 2024
8308c95
add genesis type
danwt Oct 31, 2024
72eacea
genesis
danwt Oct 31, 2024
4a6e3ed
adds genesis import/export and test for light lcient
danwt Oct 31, 2024
035d566
update the default param value
danwt Oct 31, 2024
f99f6d2
pre add genesis for xsequencer
danwt Oct 31, 2024
64f667d
partially added genesis import export
danwt Oct 31, 2024
222d3cd
why tho
danwt Oct 31, 2024
4eb9815
pre refac
danwt Oct 31, 2024
0f16ff3
lgo
danwt Oct 31, 2024
65c6cd3
trying to fix proposer addr lookup
danwt Oct 31, 2024
8804443
is this legit
danwt Oct 31, 2024
6599195
give up
danwt Oct 31, 2024
86505e5
lets see what main does
danwt Nov 1, 2024
dae9bd7
fix one test but now genesis one is broken
danwt Nov 1, 2024
266d2d0
thank god
danwt Nov 1, 2024
22ef2c9
confirm genesis is fine
danwt Nov 1, 2024
38dcab6
pre reshuffle
danwt Nov 1, 2024
cf051e7
pre close vscode
danwt Nov 1, 2024
7c97f49
confirm test pass
danwt Nov 1, 2024
23d75fb
pre reshuffle
danwt Nov 1, 2024
ba977c9
cp
danwt Nov 1, 2024
8ffc5f7
test pass
danwt Nov 1, 2024
3eb92e7
genesis tests
danwt Nov 1, 2024
383a82a
fix gomod
danwt Nov 1, 2024
11b5b10
removes todo
danwt Nov 1, 2024
ce4948c
linter
danwt Nov 1, 2024
a35bdda
linter
danwt Nov 1, 2024
4825f80
swap getBlockDescriptor and getConsensusState to allow for first ever…
danwt Nov 3, 2024
a0daaa5
docstring
danwt Nov 3, 2024
c1e19d5
Update x/rollapp/keeper/liveness.go
danwt Nov 4, 2024
260fa0b
typo
danwt Nov 4, 2024
af14b0e
improves docstring for unbond
danwt Nov 4, 2024
5a9e60d
Don't allow successor to unbond (#1386)
danwt Nov 4, 2024
fe922f1
adds error propogation to proposer choice algo
danwt Nov 4, 2024
f44d90b
linter
danwt Nov 4, 2024
028d7cb
adds some fixes from michaels suggestions
danwt Nov 5, 2024
5985c6e
more readable get and set
danwt Nov 5, 2024
5002afa
cp
danwt Nov 5, 2024
20e1a63
better docstrings
danwt Nov 5, 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
1 change: 0 additions & 1 deletion app/apptesting/test_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ func (s *KeeperTestHelper) CreateDefaultRollappAndProposer() (string, string) {
return rollappId, proposer
}

// creates a rollapp and return its rollappID
func (s *KeeperTestHelper) CreateDefaultRollapp() string {
rollappId := urand.RollappID()
s.CreateRollappByName(rollappId)
Expand Down
2 changes: 1 addition & 1 deletion app/upgrades/v4/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func migrateRollapps(ctx sdk.Context, rollappkeeper *rollappkeeper.Keeper) error
}

func migrateSequencers(ctx sdk.Context, sequencerkeeper sequencerkeeper.Keeper) {
list := sequencerkeeper.GetAllSequencers(ctx)
list := sequencerkeeper.AllSequencers(ctx)
for _, oldSequencer := range list {
newSequencer := ConvertOldSequencerToNew(oldSequencer)
sequencerkeeper.SetSequencer(ctx, newSequencer)
Expand Down
12 changes: 6 additions & 6 deletions app/upgrades/v4/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ func (s *UpgradeTestSuite) validateSequencersMigration(numSeq int) error {
for i, sequencer := range testSeqs {
expectSequencers[i] = v4.ConvertOldSequencerToNew(sequencer)
}
sequencers := s.App.SequencerKeeper.GetAllSequencers(s.Ctx)
sequencers := s.App.SequencerKeeper.AllSequencers(s.Ctx)
s.Require().Len(sequencers, len(expectSequencers))

sort.Slice(sequencers, func(i, j int) bool {
Expand All @@ -247,9 +247,9 @@ func (s *UpgradeTestSuite) validateSequencersMigration(numSeq int) error {

for i, sequencer := range sequencers {
// check that the sequencer can be retrieved by address
_, ok := s.App.SequencerKeeper.GetSequencer(s.Ctx, sequencer.Address)
if !ok {
return fmt.Errorf("sequencer by address not migrated")
_, err := s.App.SequencerKeeper.GetRealSequencer(s.Ctx, sequencer.Address)
if err != nil {
return err
}

seq := s.App.AppCodec().MustMarshalJSON(&sequencer)
Expand All @@ -260,8 +260,8 @@ func (s *UpgradeTestSuite) validateSequencersMigration(numSeq int) error {

// check proposer
for _, rollapp := range s.App.RollappKeeper.GetAllRollapps(s.Ctx) {
_, found := s.App.SequencerKeeper.GetProposer(s.Ctx, rollapp.RollappId)
s.Assert().True(found)
p := s.App.SequencerKeeper.GetProposer(s.Ctx, rollapp.RollappId)
s.Require().False(p.Sentinel())
}

return nil
Expand Down
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ require (
github.com/decred/dcrd/dcrec/edwards v1.0.0
github.com/dustin/go-humanize v1.0.1
github.com/dymensionxyz/gerr-cosmos v1.1.0
github.com/dymensionxyz/sdk-utils v0.2.10
github.com/dymensionxyz/sdk-utils v0.2.11
github.com/ethereum/go-ethereum v1.10.26
github.com/evmos/ethermint v0.22.0
github.com/gogo/protobuf v1.3.3
Expand Down Expand Up @@ -237,6 +237,7 @@ require (
replace (
// for collections
cosmossdk.io/api => cosmossdk.io/api v0.3.1

// use dymension forks
github.com/evmos/ethermint => github.com/dymensionxyz/ethermint v0.22.0-dymension-v0.4.1.0.20241013112411-5ef491708a2d
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
Expand All @@ -245,6 +246,6 @@ replace (

// broken goleveldb
github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7

github.com/tendermint/tendermint => github.com/cometbft/cometbft v0.34.29
golang.org/x/exp => golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -508,8 +508,8 @@ github.com/dymensionxyz/osmosis/osmomath v0.0.6-dymension-v0.1.0.20240820121212-
github.com/dymensionxyz/osmosis/osmomath v0.0.6-dymension-v0.1.0.20240820121212-c0e21fa21e43/go.mod h1:SdGCL9CZb14twRAJUSzb7bRE0OoopRpF2Hnd1UhJpFU=
github.com/dymensionxyz/osmosis/v15 v15.2.1-0.20241030075435-24ccb7025a59 h1:xuo5OCex6XT3HmL8O9l/+jsbT0D+Ib0LzTXQbNrDOOQ=
github.com/dymensionxyz/osmosis/v15 v15.2.1-0.20241030075435-24ccb7025a59/go.mod h1:2rsnXAdjYfXtyEw0mNwAdOiAccALYjAPvINGUf9Qg7Y=
github.com/dymensionxyz/sdk-utils v0.2.10 h1:dvUVzIpsdWGr5Ex+ltl/x1Abi+7sliwsGM1xAx/0p0k=
github.com/dymensionxyz/sdk-utils v0.2.10/go.mod h1:it9owYOpnIe17+ftTATQNDN4z+mBQx20/2Jm8SK15Rk=
github.com/dymensionxyz/sdk-utils v0.2.11 h1:BMteI8vLGFlBPDtpQalI4zP4QaFFDePPhxBbrbOXxMQ=
github.com/dymensionxyz/sdk-utils v0.2.11/go.mod h1:it9owYOpnIe17+ftTATQNDN4z+mBQx20/2Jm8SK15Rk=
github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=
github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
Expand Down
Loading
Loading