Karak Restaking - Mitigation Review

The universal restaking layer powered by the entire cryptoeconomy across every asset and every chain.

  • Start date10 Sep 2024
  • End date16 Sep 2024
  • Total awards$7,500 in USDC
  • Duration6 days

Karak Restaking Mitigation Review

Important note

Each warden must submit a mitigation review for every individual PR listed in the Scope section below. Incomplete mitigation reviews will not be eligible for awards.

Findings being mitigated

Mitigations of all High and Medium issues (+ Additional Issues to be mitigated) will be considered in-scope and listed here.

Additional issues to be mitigated:

  • [ADD-01]: packages/contracts/src/NativeVault.sol L446 + node.withdrawableCreditedNodeETH -= slashedWithdrawable;
  • [ADD-02]: packages/contracts/src/entities/NativeVaultLib.sol L177-L178
  validatorDetails.lastBalanceUpdateTimestamp =
            node.currentSnapshotTimestamp == 0 ? node.lastSnapshotTimestamp : node.currentSnapshotTimestamp;

Overview of changes

Karak Restaking is a protocol that allows users to restake their assets by directly depositing them into the vaults of operators. Operators can then register with Distributed Secure Services (DSS) to provide economic security. Operators perform tasks for the DSS in exchange for rewards, and the DSS has the ability to slash the funds that operators have delegated.

Scope

Branch

https://github.com/karak-network/karak-restaking/tree/v2

Mitigation of High & Medium Severity Issues

URLMitigation ofPurpose
https://github.com/karak-network/karak-arena-mitigations/commit/fdef9d25e2b7c0a528d5a6dfcce64a3a518165af#diff-940446432243a929cd0f5ea691c4e90d60ee655723e2d5d8fcafc7b7504cfe98R437H-01This mitigation only burns the ETH that has already been credited to the user consequently avoiding this scenario
https://github.com/karak-network/karak-arena-mitigations/commit/fdef9d25e2b7c0a528d5a6dfcce64a3a518165af#diff-940446432243a929cd0f5ea691c4e90d60ee655723e2d5d8fcafc7b7504cfe98R429H-02This mitigation removes the SlashStore altogether and the NativeVault itself burns the slashed ETH
https://github.com/karak-network/karak-arena-mitigations/commit/fdef9d25e2b7c0a528d5a6dfcce64a3a518165af#diff-940446432243a929cd0f5ea691c4e90d60ee655723e2d5d8fcafc7b7504cfe98R216H-03This mitigation introduces a check for the rounding error
https://github.com/karak-network/karak-arena-mitigations/commit/69644a7b1c3607aea5f876d9ee6be24035c1d9d2H-04This mitigation validates the operator, vaults status in the finalizing slashing
https://github.com/karak-network/karak-arena-mitigations/commit/af49375f2f7682b6372477d68d367f2dee4256caM-02This mitigation accounts for the decrease in balance of the users shares before burning
https://github.com/karak-network/karak-arena-mitigations/commit/71b4d9609b441072d2e0da62d67d6ad6cec0e550M-03This mitigation computes the slashing amount in finalize slashing
https://github.com/karak-network/karak-arena-mitigations/commit/a153880bfe7077b9f15c999297f8dbb582df1e09M-04This mitigation exposes a getter to determine if a vault's queued for slashing
https://github.com/karak-network/karak-arena-mitigations/commit/69644a7b1c3607aea5f876d9ee6be24035c1d9d2M-05This mitigation skips the slashing incase of 0 slashing amount

Additional scope to be reviewed

These are additional changes that will be in scope.

Out of Scope