Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

Feature/subnet lifecycle #17

Merged
merged 8 commits into from
Mar 16, 2023
Merged

Feature/subnet lifecycle #17

merged 8 commits into from
Mar 16, 2023

Conversation

mikirov
Copy link
Contributor

@mikirov mikirov commented Mar 2, 2023

Join, leave, kill, commitChildCheck SA methods with their corresponding GW handlers, forge tests for SA and GW for all methods

arrusev and others added 4 commits March 2, 2023 12:41
…ister, releaseStake, kill in GW

feat: implement join, leave, kill, reward method in SA, addStake, register, releaseStake, kill in GW

feat: distribute tokens to validators, reentrancy guard

chore: interface changes, test cleanup
…op, checkpoint and subnetId helper libraries

feat: add commitChildCheck implementation

Signed-off-by: Anton Rusev <anton.rusev@limechain.tech>

refactor: child checks with nested loop

Signed-off-by: Anton Rusev <anton.rusev@limechain.tech>

refactor: make getSubnet internal helper function

Signed-off-by: Anton Rusev <anton.rusev@limechain.tech>

WIP: checkpoint helper library and checkpoint test
…d library

feat: add constants and storable message helper

feat: simplify subnetId, add helper libraries

fix: tests
…nt tests, GW commitChildCheck tests

test: add commitChildCheck tests

Signed-off-by: Anton Rusev <anton.rusev@limechain.tech>

feat: SA commitCheckpoint tests

fix: save multiple subnets to the same checkpoint

Signed-off-by: Anton Rusev <anton.rusev@limechain.tech>
@mikirov mikirov requested a review from arrusev March 2, 2023 10:56
Signed-off-by: Anton Rusev <anton.rusev@limechain.tech>
mikirov and others added 2 commits March 6, 2023 10:48
… cross msg in GW, refactor join method and tests, fix interfaces

Signed-off-by: Anton Rusev <anton.rusev@limechain.tech>

fix: add one more condition to cross msg in GW

Signed-off-by: Anton Rusev <anton.rusev@limechain.tech>

refactor: join method

fix: join interface, test join calls, GW call on SA reward method

feat: fix GW to distribute fees only if fees > 0

Signed-off-by: Anton Rusev <anton.rusev@limechain.tech>

fix: reward distribution

fix: join method and tests
@arrusev arrusev marked this pull request as ready for review March 7, 2023 10:13
Copy link
Contributor

@2dpetkov 2dpetkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are several comments where SCA is mentioned, we should change to GW

src/SubnetActor.sol Outdated Show resolved Hide resolved
src/SubnetActor.sol Outdated Show resolved Hide resolved
src/lib/SubnetIDHelper.sol Outdated Show resolved Hide resolved
src/lib/SubnetIDHelper.sol Outdated Show resolved Hide resolved
src/lib/CheckpointMappingHelper.sol Outdated Show resolved Hide resolved
src/SubnetActor.sol Outdated Show resolved Hide resolved
src/SubnetActor.sol Outdated Show resolved Hide resolved
src/SubnetActor.sol Outdated Show resolved Hide resolved
src/SubnetActor.sol Outdated Show resolved Hide resolved
src/SubnetActor.sol Show resolved Hide resolved
Copy link
Contributor

@bamzedev bamzedev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall the coverage is pretty low. We need to add more tests.

src/Gateway.sol Show resolved Hide resolved
src/lib/SubnetIDHelper.sol Outdated Show resolved Hide resolved
src/lib/SubnetIDHelper.sol Show resolved Hide resolved
src/lib/CheckpointMappingHelper.sol Show resolved Hide resolved
src/SubnetActor.sol Outdated Show resolved Hide resolved
src/lib/CheckpointHelper.sol Show resolved Hide resolved
src/lib/CheckpointMappingHelper.sol Outdated Show resolved Hide resolved
src/lib/CheckpointMappingHelper.sol Show resolved Hide resolved
src/lib/CheckpointHelper.sol Show resolved Hide resolved
test/CheckpointMappingHelper.t.sol Outdated Show resolved Hide resolved
test/Gateway.t.sol Outdated Show resolved Hide resolved
test/SubnetActor.t.sol Outdated Show resolved Hide resolved
2dpetkov
2dpetkov previously approved these changes Mar 15, 2023
…unit test coverage, interface and file cleanup that misleads coverage, compile time constatnt evaluation

feat: refactor join method and formatting, fix helpers, PR comments, add unit test coverage

fix: underflow error in SubnetIDHelper when it contains a single route

Signed-off-by: Anton Rusev <anton.rusev@limechain.tech>

fix: PR comments

fix: subnetId helper

test: add test coverage for helper libs

Signed-off-by: Anton Rusev <anton.rusev@limechain.tech>

refactor: interface and file cleanup that misleads coverage

refactor: use compile-time expression evaluation instead of hardcoded hashes

Signed-off-by: Anton Rusev <anton.rusev@limechain.tech>

feat: add SA tests

feat: add default Status, cpHelper fuzz tests, cpmHelper tests

Signed-off-by: Anton Rusev <anton.rusev@limechain.tech>

feat: submit checkpoint tests
2dpetkov
2dpetkov previously approved these changes Mar 16, 2023
@mikirov mikirov merged commit 46afe66 into main Mar 16, 2023
@dnkolegov dnkolegov deleted the feature/subnet-lifecycle branch June 27, 2023 09:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants