Skip to content

Commit

Permalink
chore: reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
madlabman committed Oct 10, 2024
1 parent f445d6d commit 77c3b02
Show file tree
Hide file tree
Showing 37 changed files with 2,688 additions and 2,503 deletions.
122 changes: 61 additions & 61 deletions csm-alerts/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,66 +1,66 @@
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
sourceType: 'module',
},
settings: {
'import/resolver': {
typescript: {
project: './tsconfig.json',
},
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
sourceType: 'module',
},
},
plugins: ['@typescript-eslint', 'prettier', 'import'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
],
root: true,
env: {
node: true,
jest: true,
},
ignorePatterns: ['.eslintrc.js'],
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'sort-imports': [
'error',
{
ignoreCase: false,
ignoreDeclarationSort: true, // don't want to sort import lines, use eslint-plugin-import instead
ignoreMemberSort: false,
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
allowSeparatedGroups: true,
},
],
'import/no-unresolved': 'error',
'import/order': [
'error',
{
groups: [
'builtin', // Built-in imports (come from NodeJS native) go first
'external', // <- External imports
'internal', // <- Absolute imports
['sibling', 'parent'], // <- Relative imports, the sibling and parent types they can be mingled together
'index', // <- index imports
'unknown', // <- unknown
],
'newlines-between': 'always',
alphabetize: {
/* sort in ascending order. Options: ["ignore", "asc", "desc"] */
order: 'asc',
/* ignore case. Options: [true, false] */
caseInsensitive: true,
settings: {
'import/resolver': {
typescript: {
project: './tsconfig.json',
},
},
},
},
plugins: ['@typescript-eslint', 'prettier', 'import'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
],
},
root: true,
env: {
node: true,
jest: true,
},
ignorePatterns: ['.eslintrc.js'],
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'sort-imports': [
'error',
{
ignoreCase: false,
ignoreDeclarationSort: true, // don't want to sort import lines, use eslint-plugin-import instead
ignoreMemberSort: false,
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
allowSeparatedGroups: true,
},
],
'import/no-unresolved': 'error',
'import/order': [
'error',
{
groups: [
'builtin', // Built-in imports (come from NodeJS native) go first
'external', // <- External imports
'internal', // <- Absolute imports
['sibling', 'parent'], // <- Relative imports, the sibling and parent types they can be mingled together
'index', // <- index imports
'unknown', // <- unknown
],
'newlines-between': 'always',
alphabetize: {
/* sort in ascending order. Options: ["ignore", "asc", "desc"] */
order: 'asc',
/* ignore case. Options: [true, false] */
caseInsensitive: true,
},
},
],
},
}
4 changes: 2 additions & 2 deletions csm-alerts/.prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"semi": false,
"trailingComma": "all",
"singleQuote": true,
"printWidth": 120,
"tabWidth": 2
"printWidth": 100,
"tabWidth": 4
}
214 changes: 107 additions & 107 deletions csm-alerts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,133 +2,133 @@

## Supported chains

- Holesky testnet
- Holesky testnet

## Alerts

1. **CSModule**
1. General
1. πŸ”΄ HIGH: EL rewards stealing penalty reported/settled/cancelled for an operator.
2. 🟠 MEDIUM: targetLimitMode was set for an operator.
3. 🟒 LOW: Module's share is close to the targetShare.
4. 🟒 LOW: More than N "empty" batches in the queue. (N = 30)
5. 🟒 LOW: More than N validators in the queue. (N = 200)
6. πŸ”΅ INFO: Operator X was unvetted.
7. πŸ”΅ INFO: Public release is activated.
8. πŸ”΅ INFO: Every 100 new operators created (69th as well).
2. Roles monitoring
1. 🚨 CRITICAL: role change: DEFAULT_ADMIN_ROLE
2. 🚨 CRITICAL: role change: PAUSE_ROLE
3. 🚨 CRITICAL: role change: RESUME_ROLE
4. 🚨 CRITICAL: role change: MODULE_MANAGER_ROLE
5. 🚨 CRITICAL: role change: STAKING_ROUTER_ROLE
6. 🚨 CRITICAL: role change: REPORT_EL_REWARDS_STEALING_PENALTY_ROLE
7. 🚨 CRITICAL: role change: SETTLE_EL_REWARDS_STEALING_PENALTY_ROLE
8. 🚨 CRITICAL: role change: VERIFIER_ROLE
9. 🚨 CRITICAL: role change: RECOVERER_ROLE
1. General
1. πŸ”΄ HIGH: EL rewards stealing penalty reported/settled/cancelled for an operator.
2. 🟠 MEDIUM: targetLimitMode was set for an operator.
3. 🟒 LOW: Module's share is close to the targetShare.
4. 🟒 LOW: More than N "empty" batches in the queue. (N = 30)
5. 🟒 LOW: More than N validators in the queue. (N = 200)
6. πŸ”΅ INFO: Operator X was unvetted.
7. πŸ”΅ INFO: Public release is activated.
8. πŸ”΅ INFO: Every 100 new operators created (69th as well).
2. Roles monitoring
1. 🚨 CRITICAL: role change: DEFAULT_ADMIN_ROLE
2. 🚨 CRITICAL: role change: PAUSE_ROLE
3. 🚨 CRITICAL: role change: RESUME_ROLE
4. 🚨 CRITICAL: role change: MODULE_MANAGER_ROLE
5. 🚨 CRITICAL: role change: STAKING_ROUTER_ROLE
6. 🚨 CRITICAL: role change: REPORT_EL_REWARDS_STEALING_PENALTY_ROLE
7. 🚨 CRITICAL: role change: SETTLE_EL_REWARDS_STEALING_PENALTY_ROLE
8. 🚨 CRITICAL: role change: VERIFIER_ROLE
9. 🚨 CRITICAL: role change: RECOVERER_ROLE
2. **CSAccounting**
1. General
1. 🟒 LOW: Average bond value for a validator is below some threshold.
2. 🟒 LOW: Total bond lock more than some value.
3. 🟒 LOW: sharesOf(CSAccounting.address) - CSBondCoreStorage.totalBondShares > 0.1 ether
2. Events monitoring
1. 🚨 CRITICAL: ChargePenaltyRecipientSet(address chargeRecipient)
2. 🚨 CRITICAL: BondCurveUpdated(uint256 indexed curveId, uint256[] bondCurve)
3. πŸ”΄ HIGH: BondCurveAdded(uint256[] bondCurve)
4. πŸ”΄ HIGH: BondCurveSet(uint256 indexed nodeOperatorId, uint256 curveId)
5. πŸ”΅ INFO: Approval(address owner, address spender, uint256 value) (stETH contract)
3. Roles monitoring
1. 🚨 CRITICAL: DEFAULT_ADMIN_ROLE
2. 🚨 CRITICAL: PAUSE_ROLE
3. 🚨 CRITICAL: RESUME_ROLE
4. 🚨 CRITICAL: ACCOUNTING_MANAGER_ROLE
5. 🚨 CRITICAL: MANAGE_BOND_CURVES_ROLE
6. 🚨 CRITICAL: SET_BOND_CURVE_ROLE
7. 🚨 CRITICAL: RESET_BOND_CURVE_ROLE
8. 🚨 CRITICAL: RECOVERER_ROLE
1. General
1. 🟒 LOW: Average bond value for a validator is below some threshold.
2. 🟒 LOW: Total bond lock more than some value.
3. 🟒 LOW: sharesOf(CSAccounting.address) - CSBondCoreStorage.totalBondShares > 0.1 ether
2. Events monitoring
1. 🚨 CRITICAL: ChargePenaltyRecipientSet(address chargeRecipient)
2. 🚨 CRITICAL: BondCurveUpdated(uint256 indexed curveId, uint256[] bondCurve)
3. πŸ”΄ HIGH: BondCurveAdded(uint256[] bondCurve)
4. πŸ”΄ HIGH: BondCurveSet(uint256 indexed nodeOperatorId, uint256 curveId)
5. πŸ”΅ INFO: Approval(address owner, address spender, uint256 value) (stETH contract)
3. Roles monitoring
1. 🚨 CRITICAL: DEFAULT_ADMIN_ROLE
2. 🚨 CRITICAL: PAUSE_ROLE
3. 🚨 CRITICAL: RESUME_ROLE
4. 🚨 CRITICAL: ACCOUNTING_MANAGER_ROLE
5. 🚨 CRITICAL: MANAGE_BOND_CURVES_ROLE
6. 🚨 CRITICAL: SET_BOND_CURVE_ROLE
7. 🚨 CRITICAL: RESET_BOND_CURVE_ROLE
8. 🚨 CRITICAL: RECOVERER_ROLE
3. **CSFeeOracle**
1. General
1. 🚨 CRITICAL: ConsensusHashContractSet(address indexed addr, address indexed prevAddr)
2. πŸ”΄ HIGH: PerfLeewaySet(uint256 valueBP)
3. πŸ”΄ HIGH: FeeDistributorContractSet(address feeDistributorContract)
4. πŸ”΄ HIGH: ConsensusVersionSet(uint256 indexed version, uint256 indexed prevVersion)
5. πŸ”΅ INFO: WarnProcessingMissed(uint256 indexed refSlot)
6. πŸ”΅ INFO: ReportSubmitted(uint256 indexed refSlot, bytes32 hash, uint256 processingDeadlineTime)
7. πŸ”΅ INFO: ProcessingStarted(uint256 indexed refSlot, bytes32 hash)
2. Roles monitoring
1. 🚨 CRITICAL: DEFAULT_ADMIN_ROLE
2. 🚨 CRITICAL: CONTRACT_MANAGER_ROLE
3. 🚨 CRITICAL: SUBMIT_DATA_ROLE
4. 🚨 CRITICAL: PAUSE_ROLE
5. 🚨 CRITICAL: RESUME_ROLE
6. 🚨 CRITICAL: RECOVERER_ROLE
3. HashConsensus (for CSFeeOracle)
1. Events monitoring
1. πŸ”΄ HIGH: MemberAdded(address indexed addr, uint256 newTotalMembers, uint256 newQuorum)
2. πŸ”΄ HIGH: MemberRemoved(address indexed addr, uint256 newTotalMembers, uint256 newQuorum)
3. πŸ”΄ HIGH: QuorumSet(uint256 newQuorum, uint256 totalMembers, uint256 prevQuorum)
4. πŸ”΄ HIGH: FastLaneConfigSet(uint256 fastLaneLengthSlots)
5. πŸ”΄ HIGH: FrameConfigSet(uint256 newInitialEpoch, uint256 newEpochsPerFrame)
6. πŸ”΄ HIGH: ReportProcessorSet(address indexed processor, address indexed prevProcessor)
7. πŸ”΄ HIGH: another report variant appeared (alternative hash) event ReportReceived(uint256 indexed refSlot, address indexed member, bytes32 report)
8. πŸ”΄ HIGH: ConsensusLost(uint256 indexed refSlot)
9. πŸ”΅ INFO: ConsensusReached(uint256 indexed refSlot, bytes32 report, uint256 support)
2. Roles monitoring
1. 🚨 CRITICAL: DEFAULT_ADMIN_ROLE
2. 🚨 CRITICAL: DISABLE_CONSENSUS_ROLE
3. 🚨 CRITICAL: MANAGE_MEMBERS_AND_QUORUM_ROLE
4. 🚨 CRITICAL: MANAGE_FRAME_CONFIG_ROLE
5. 🚨 CRITICAL: MANAGE_FAST_LANE_CONFIG_ROLE
6. 🚨 CRITICAL: MANAGE_REPORT_PROCESSOR_ROLE
1. General
1. 🚨 CRITICAL: ConsensusHashContractSet(address indexed addr, address indexed prevAddr)
2. πŸ”΄ HIGH: PerfLeewaySet(uint256 valueBP)
3. πŸ”΄ HIGH: FeeDistributorContractSet(address feeDistributorContract)
4. πŸ”΄ HIGH: ConsensusVersionSet(uint256 indexed version, uint256 indexed prevVersion)
5. πŸ”΅ INFO: WarnProcessingMissed(uint256 indexed refSlot)
6. πŸ”΅ INFO: ReportSubmitted(uint256 indexed refSlot, bytes32 hash, uint256 processingDeadlineTime)
7. πŸ”΅ INFO: ProcessingStarted(uint256 indexed refSlot, bytes32 hash)
2. Roles monitoring
1. 🚨 CRITICAL: DEFAULT_ADMIN_ROLE
2. 🚨 CRITICAL: CONTRACT_MANAGER_ROLE
3. 🚨 CRITICAL: SUBMIT_DATA_ROLE
4. 🚨 CRITICAL: PAUSE_ROLE
5. 🚨 CRITICAL: RESUME_ROLE
6. 🚨 CRITICAL: RECOVERER_ROLE
3. HashConsensus (for CSFeeOracle)
1. Events monitoring
1. πŸ”΄ HIGH: MemberAdded(address indexed addr, uint256 newTotalMembers, uint256 newQuorum)
2. πŸ”΄ HIGH: MemberRemoved(address indexed addr, uint256 newTotalMembers, uint256 newQuorum)
3. πŸ”΄ HIGH: QuorumSet(uint256 newQuorum, uint256 totalMembers, uint256 prevQuorum)
4. πŸ”΄ HIGH: FastLaneConfigSet(uint256 fastLaneLengthSlots)
5. πŸ”΄ HIGH: FrameConfigSet(uint256 newInitialEpoch, uint256 newEpochsPerFrame)
6. πŸ”΄ HIGH: ReportProcessorSet(address indexed processor, address indexed prevProcessor)
7. πŸ”΄ HIGH: another report variant appeared (alternative hash) event ReportReceived(uint256 indexed refSlot, address indexed member, bytes32 report)
8. πŸ”΄ HIGH: ConsensusLost(uint256 indexed refSlot)
9. πŸ”΅ INFO: ConsensusReached(uint256 indexed refSlot, bytes32 report, uint256 support)
2. Roles monitoring
1. 🚨 CRITICAL: DEFAULT_ADMIN_ROLE
2. 🚨 CRITICAL: DISABLE_CONSENSUS_ROLE
3. 🚨 CRITICAL: MANAGE_MEMBERS_AND_QUORUM_ROLE
4. 🚨 CRITICAL: MANAGE_FRAME_CONFIG_ROLE
5. 🚨 CRITICAL: MANAGE_FAST_LANE_CONFIG_ROLE
6. 🚨 CRITICAL: MANAGE_REPORT_PROCESSOR_ROLE
4. **CSFeeDistributor**

1. Events monitoring
1. 🚨 CRITICAL: Receiver of TransferShares is NOT CSAccounting, if from is CSFeeDistributor
2. πŸ”΄ HIGH: No fees distributed for X days (repeat every 1 day).
3. πŸ”΅ INFO: DistributionDataUpdated -> Oracle settled a new report.
2. Roles monitoring
1. 🚨 CRITICAL: DEFAULT_ADMIN_ROLE
2. 🚨 CRITICAL: RECOVERER_ROLE
1. Events monitoring
1. 🚨 CRITICAL: Receiver of TransferShares is NOT CSAccounting, if from is CSFeeDistributor
2. πŸ”΄ HIGH: No fees distributed for X days (repeat every 1 day).
3. πŸ”΅ INFO: DistributionDataUpdated -> Oracle settled a new report.
2. Roles monitoring
1. 🚨 CRITICAL: DEFAULT_ADMIN_ROLE
2. 🚨 CRITICAL: RECOVERER_ROLE

5. **CSEarlyAdoption**

- _To be added_
- _To be added_

6. **OssifiableProxy**
For the following contracts:

- CSModule
- CSAccounting
- CSFeeOracle
- CSFeeDistributor
- CSModule
- CSAccounting
- CSFeeOracle
- CSFeeDistributor

1. 🚨 CRITICAL: event ProxyOssified()
2. 🚨 CRITICAL: event Upgraded(address indexed implementation)
3. 🚨 CRITICAL: event AdminChanged(address previousAdmin, address newAdmin)
1. 🚨 CRITICAL: event ProxyOssified()
2. 🚨 CRITICAL: event Upgraded(address indexed implementation)
3. 🚨 CRITICAL: event AdminChanged(address previousAdmin, address newAdmin)

7. **PausableUntil**
For the following contracts:

- CSModule
- CSAccounting
- CSFeeOracle
- CSModule
- CSAccounting
- CSFeeOracle

1. 🚨 CRITICAL: Paused(uint256 duration);
2. 🚨 CRITICAL: Resumed();
1. 🚨 CRITICAL: Paused(uint256 duration);
2. 🚨 CRITICAL: Resumed();

8. **AssetRecoverer**
For the following contracts:

- CSModule
- CSAccounting
- CSFeeOracle
- CSFeeDistributor
- CSModule
- CSAccounting
- CSFeeOracle
- CSFeeDistributor

1. πŸ”΄ HIGH: EtherRecovered()
2. πŸ”΄ HIGH: ERC20Recovered()
3. πŸ”΄ HIGH: StETHSharesRecovered()
4. πŸ”΄ HIGH: ERC721Recovered()
5. πŸ”΄ HIGH: ERC1155Recovered()
1. πŸ”΄ HIGH: EtherRecovered()
2. πŸ”΄ HIGH: ERC20Recovered()
3. πŸ”΄ HIGH: StETHSharesRecovered()
4. πŸ”΄ HIGH: ERC721Recovered()
5. πŸ”΄ HIGH: ERC1155Recovered()

## Development (Forta specific)

Expand All @@ -150,12 +150,12 @@ docker-compose up -d

1. For testing alerts you have to install promtool on your machine.

```
make tools
```
```
make tools
```

2. Check alerts

```
make test_alerts
```
```
make test_alerts
```
Loading

0 comments on commit 77c3b02

Please sign in to comment.