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: implement KRO-based validator system #374

Merged
merged 81 commits into from
Aug 23, 2024
Merged
Changes from 1 commit
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
bcafeda
feat(contracts): add arctangent library
sm-stack Mar 8, 2024
7bc46e5
feat(contracts): add AssetManager contract
sm-stack Mar 8, 2024
34a2700
feat(contracts): add interface for KGHManager contract
sm-stack Mar 8, 2024
15e0c7f
feat(contracts): add test codes for AssetManager
sm-stack Mar 8, 2024
cef7a30
feat(contracts): add Uint128Math library
sm-stack Mar 11, 2024
a726010
feat(contracts): add balanced weight tree library
seolaoh Mar 11, 2024
1c9e2ad
fix(contracts): check correct minimum timestamp for next output submi…
seolaoh Feb 28, 2024
62c9912
feat(contracts): add `ValidatorManager` contract and refac `AssetMana…
seolaoh Mar 29, 2024
0cb9f85
feat(contracts): handle validator system upgrade in `L2OutputOracle`
seolaoh Mar 18, 2024
208cd2a
feat(chain-ops): apply changes with `AssetManager` and `ValidatorMana…
seolaoh Mar 27, 2024
0108d07
chore(contracts): update bindings and snapshots
seolaoh Mar 29, 2024
c39f2da
feat(contracts): apply PR reviews
seolaoh Apr 18, 2024
a96e0a2
feat(contracts): upgrade validator system in `Colosseum`
seolaoh Apr 17, 2024
dbed8b6
refac(contracts): replace all errors with custom error in `Colosseum`
seolaoh Apr 17, 2024
1a693d3
feat(contracts): send the challenge loser to jail when slashing
seolaoh Apr 18, 2024
0d94687
refac(contracts): move interfaces to separate folder
seolaoh Apr 18, 2024
85f26e8
refac(contracts): add `IAssetManager`
seolaoh Apr 18, 2024
d30a495
test(contracts): modify tests related to slashing
seolaoh Apr 19, 2024
edf7208
test(contracts): add tests for validator system upgrade in `Colosseum`
seolaoh Apr 21, 2024
9d1bfff
chore(contracts): update bindings and snapshots
seolaoh Apr 21, 2024
16802c3
feat(contracts): apply PR reviews
seolaoh Apr 23, 2024
2511cbc
feat(validator): add logics for new validator system
sm-stack Apr 2, 2024
852e5b8
feat(e2e): add action tests for new validator system
sm-stack Apr 2, 2024
0c05940
chore: set required flags for devnet
sm-stack Apr 17, 2024
02d5012
fix(validator): add real-time update logic for terminate index of Val…
sm-stack Apr 21, 2024
333f513
fix(contracts): fix ValidatorPool to check termination by index
sm-stack Apr 22, 2024
95665a2
fix(validator): remove inJail status in the validator client
sm-stack Apr 22, 2024
8169f41
feat(validator): apply PR Reviews
sm-stack Apr 23, 2024
85c9784
feat(validator): add subcommands for the new validator system
sm-stack Apr 17, 2024
845b217
feat(validator): add flags used in subcommands
sm-stack Apr 23, 2024
8a5d782
docs(validator): add README for subcommands
sm-stack Apr 24, 2024
a5a8009
feat(validator): add PR reviews
sm-stack Apr 24, 2024
7142220
fix(validator): fix subcommand related changes
seolaoh May 2, 2024
6bfa308
test(validator): redeploy `ValidatorPool` to test `ValidatorManager`
seolaoh May 3, 2024
c99be8b
refac(validator): reorder functions of l2_validator
seolaoh May 7, 2024
2195eca
test(validator): add challenger actions test for `ValidatorManager`
seolaoh May 7, 2024
3d8e78b
refac(validator): reorder functions of l2_challenger_test
seolaoh May 7, 2024
80817d4
refac(validator): add runtime functions to use in validator actions test
seolaoh May 8, 2024
06bff6d
refac(validator): reorder functions of l2_runtime
seolaoh May 8, 2024
64592da
test(validator): apply PR reviews
seolaoh May 9, 2024
46cc561
Merge branch 'refs/heads/dev' into feat/implement-validator-system-v2
seolaoh May 10, 2024
6ce71fb
feat(validator): modify guardian to handle challenger timeout (#320)
seolaoh May 17, 2024
c6cce6f
feat(contracts): support validator system V2 from genesis (#322)
seolaoh May 21, 2024
7f91022
test(e2e): add tests about validator system V2 (#323)
seolaoh May 27, 2024
9c41722
fix: remove validator from tree when sending to jail (#325)
seolaoh May 29, 2024
9c507ba
fix(contracts): fix some bugs related to `AssetManager` (#327)
seolaoh Jun 5, 2024
1474ae4
fix(validator): change challenger and guardian scan until head L1 (#330)
seolaoh Jun 5, 2024
7359dbe
Merge branch 'refs/heads/dev' into feat/implement-validator-system-v2
seolaoh Jun 7, 2024
38772d2
Merge branch 'refs/heads/dev' into feat/implement-validator-system-v2
seolaoh Jul 3, 2024
14047a3
feat: deploy `GovernanceToken` using normal proxy for devnet
seolaoh Jul 4, 2024
481160e
Merge remote-tracking branch 'origin/dev' into feat/implement-validat…
seolaoh Jul 12, 2024
45760b5
feat(contracts): add withdraw account to validator (#343)
0xHansLee Jul 15, 2024
b9c706a
feat: add delay of commission rate change (#345)
seolaoh Jul 17, 2024
99e6a68
feat(contracts): separate validator kro from delegation pool (#344)
0xHansLee Jul 17, 2024
104b313
feat(contracts): fix interface of `ValidatorManager`, `AssetManager` …
seolaoh Jul 18, 2024
a7529b0
feat(contracts): bond validator KRO (#347)
seolaoh Jul 19, 2024
6e0ec89
feat: implement claimKghReward function (#348)
sm-stack Jul 19, 2024
bf82155
feat: remove KGH share and modify KGH delegation func (#349)
0xHansLee Jul 19, 2024
ceedcb0
feat(contracts): separate jail period (#352)
sm-stack Jul 22, 2024
b5b2ec9
feat(contracts): unbond validator KRO (#351)
seolaoh Jul 22, 2024
627c070
feat(contracts): add transferFrom when increasing reward of vault (#354)
sm-stack Jul 22, 2024
7abe40c
feat(contracts): update validator reward calculation (#355)
sm-stack Jul 22, 2024
8eab79f
feat(contracts): implement 1-step undelegation of KRO (#350)
0xHansLee Jul 22, 2024
e0f36b0
feat(contracts): implement 1-step undelegation for KGH (#353)
0xHansLee Jul 23, 2024
b7dd902
chore: remove 2 step claim of validator reward. (#356)
0xHansLee Jul 23, 2024
f8bbed7
feat(contracts): remove KRO in KGH (#358)
seolaoh Jul 23, 2024
0b00b05
feat(contracts): add withdraw method for validator (#357)
sm-stack Jul 23, 2024
3f0e5ec
test(contracts): setup for `AssetManager` and `ValidatorManager` (#359)
seolaoh Jul 23, 2024
c0c77dd
test(contracts): add `AssetManager` tests (#361)
seolaoh Jul 25, 2024
c77accc
feat: change validator client subcommands (#360)
sm-stack Jul 25, 2024
01f14c6
feat: modify validator client for validator system V2 (#362)
sm-stack Jul 26, 2024
b70a4e3
test(contracts): modify `Colosseum` tests related to V2 (#363)
seolaoh Jul 26, 2024
1c302b5
test: fix validator manager contract tests (#364)
0xHansLee Jul 26, 2024
042efa8
feat(contracts): modify deploy scripts (#365)
seolaoh Jul 30, 2024
5583cf9
test(validator): modify e2e tests related to V2 (#366)
seolaoh Jul 30, 2024
ab37de4
feat(contracts): auto activate validator when deposit (#367)
seolaoh Jul 31, 2024
aca9645
fix(validator): modify validator to be able to turn on without V2 (#368)
seolaoh Aug 1, 2024
f885f5f
fix(validator): disable validator to be turned on without V2 (#369)
seolaoh Aug 2, 2024
96aec79
fix(contracts): avoid overflow error during calculating output reward…
seolaoh Aug 2, 2024
4f5570d
feat(contracts): apply audit results (#373)
seolaoh Aug 22, 2024
75ae796
Merge branch 'refs/heads/dev' into feat/implement-validator-system-v2
seolaoh Aug 23, 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
Prev Previous commit
Next Next commit
refac(validator): reorder functions of l2_runtime
  • Loading branch information
seolaoh committed May 10, 2024
commit 06bff6db2a5ae21b1877377214f1822ea75600da
70 changes: 35 additions & 35 deletions op-e2e/actions/l2_runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,41 +237,6 @@ func (rt *Runtime) setupOutputSubmitted(version uint64) {
}
}

// proceedWithBlocks proceeds n blocks.
func (rt *Runtime) proceedWithBlocks(n int) {
for i := 0; i < n; i++ {
// L1 block
rt.miner.ActEmptyBlock(rt.t)
// L2 block
rt.sequencer.ActL1HeadSignal(rt.t)
rt.sequencer.ActL2PipelineFull(rt.t)
rt.sequencer.ActBuildToL1Head(rt.t)
// submit and include in L1
rt.batcher.ActSubmitAll(rt.t)
rt.includeL1BlockBySender(rt.dp.Addresses.Batcher)
// finalize the first and second L1 blocks, including the batch
rt.miner.ActL1SafeNext(rt.t)
rt.miner.ActL1SafeNext(rt.t)
rt.miner.ActL1FinalizeNext(rt.t)
rt.miner.ActL1FinalizeNext(rt.t)
// derive and see the L2 chain fully finalize
rt.sequencer.ActL2PipelineFull(rt.t)
rt.sequencer.ActL1SafeSignal(rt.t)
rt.sequencer.ActL1FinalizedSignal(rt.t)
}
}

func (rt *Runtime) submitL2Output() {
// submit to L1
rt.validator.ActSubmitL2Output(rt.t)
// include output on L1
rt.includeL1BlockBySender(rt.validator.address)
// Check submission was successful
receipt, err := rt.miner.EthClient().TransactionReceipt(rt.t.Ctx(), rt.validator.LastSubmitL2OutputTx())
require.NoError(rt.t, err)
require.Equal(rt.t, types.ReceiptStatusSuccessful, receipt.Status, "submission failed")
}

// setupChallenge sets challenge by challenger.
func (rt *Runtime) setupChallenge(challenger *L2Validator, version uint64) {
// check that the output root that L1 stores is different from challenger's output root
Expand Down Expand Up @@ -356,6 +321,41 @@ func (rt *Runtime) registerToValMan(validator *L2Validator) {
require.Equal(rt.t, val.StatusActive, status)
}

// proceedWithBlocks proceeds n blocks.
func (rt *Runtime) proceedWithBlocks(n int) {
for i := 0; i < n; i++ {
// L1 block
rt.miner.ActEmptyBlock(rt.t)
// L2 block
rt.sequencer.ActL1HeadSignal(rt.t)
rt.sequencer.ActL2PipelineFull(rt.t)
rt.sequencer.ActBuildToL1Head(rt.t)
// submit and include in L1
rt.batcher.ActSubmitAll(rt.t)
rt.includeL1BlockBySender(rt.dp.Addresses.Batcher)
// finalize the first and second L1 blocks, including the batch
rt.miner.ActL1SafeNext(rt.t)
rt.miner.ActL1SafeNext(rt.t)
rt.miner.ActL1FinalizeNext(rt.t)
rt.miner.ActL1FinalizeNext(rt.t)
// derive and see the L2 chain fully finalize
rt.sequencer.ActL2PipelineFull(rt.t)
rt.sequencer.ActL1SafeSignal(rt.t)
rt.sequencer.ActL1FinalizedSignal(rt.t)
}
}

func (rt *Runtime) submitL2Output() {
// submit to L1
rt.validator.ActSubmitL2Output(rt.t)
// include output on L1
rt.includeL1BlockBySender(rt.validator.address)
// Check submission was successful
receipt, err := rt.miner.EthClient().TransactionReceipt(rt.t.Ctx(), rt.validator.LastSubmitL2OutputTx())
require.NoError(rt.t, err)
require.Equal(rt.t, types.ReceiptStatusSuccessful, receipt.Status, "submission failed")
}

func (rt *Runtime) includeL1BlockBySender(from common.Address) {
rt.miner.includeL1BlockBySender(rt.t, from, rt.l1BlockDelta)
}
Expand Down