Skip to content

Commit

Permalink
adds subgraph indexing of ejection manager events (Layr-Labs#798)
Browse files Browse the repository at this point in the history
  • Loading branch information
pschork authored Oct 11, 2024
1 parent 6ef7538 commit f5a3c52
Show file tree
Hide file tree
Showing 9 changed files with 556 additions and 7 deletions.
4 changes: 3 additions & 1 deletion subgraphs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

eigenda-operator-state/networks.json
eigenda-operator-state/subgraph.yaml
eigenda-operator-state/Makefile

eigenda-batch-metadata/networks.json
eigenda-batch-metadata/subgraph.yaml
eigenda-batch-metadata/subgraph.yaml
eigenda-batch-metadata/Makefile
1 change: 1 addition & 0 deletions subgraphs/eigenda-operator-state/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v0.7.0
300 changes: 300 additions & 0 deletions subgraphs/eigenda-operator-state/abis/EjectionManager.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,300 @@
[
{
"inputs": [
{
"internalType": "contract IRegistryCoordinator",
"name": "_registryCoordinator",
"type": "address"
},
{
"internalType": "contract IStakeRegistry",
"name": "_stakeRegistry",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "ejector",
"type": "address"
},
{
"indexed": false,
"internalType": "bool",
"name": "status",
"type": "bool"
}
],
"name": "EjectorUpdated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint8",
"name": "version",
"type": "uint8"
}
],
"name": "Initialized",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "bytes32",
"name": "operatorId",
"type": "bytes32"
},
{
"indexed": false,
"internalType": "uint8",
"name": "quorumNumber",
"type": "uint8"
}
],
"name": "OperatorEjected",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint32",
"name": "ejectedOperators",
"type": "uint32"
},
{
"indexed": false,
"internalType": "bool",
"name": "ratelimitHit",
"type": "bool"
}
],
"name": "QuorumEjection",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint8",
"name": "quorumNumber",
"type": "uint8"
},
{
"indexed": false,
"internalType": "uint32",
"name": "rateLimitWindow",
"type": "uint32"
},
{
"indexed": false,
"internalType": "uint16",
"name": "ejectableStakePercent",
"type": "uint16"
}
],
"name": "QuorumEjectionParamsSet",
"type": "event"
},
{
"inputs": [
{ "internalType": "uint8", "name": "_quorumNumber", "type": "uint8" }
],
"name": "amountEjectableForQuorum",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32[][]",
"name": "_operatorIds",
"type": "bytes32[][]"
}
],
"name": "ejectOperators",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "_owner", "type": "address" },
{ "internalType": "address[]", "name": "_ejectors", "type": "address[]" },
{
"components": [
{
"internalType": "uint32",
"name": "rateLimitWindow",
"type": "uint32"
},
{
"internalType": "uint16",
"name": "ejectableStakePercent",
"type": "uint16"
}
],
"internalType": "struct IEjectionManager.QuorumEjectionParams[]",
"name": "_quorumEjectionParams",
"type": "tuple[]"
}
],
"name": "initialize",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [{ "internalType": "address", "name": "", "type": "address" }],
"name": "isEjector",
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }],
"name": "quorumEjectionParams",
"outputs": [
{ "internalType": "uint32", "name": "rateLimitWindow", "type": "uint32" },
{
"internalType": "uint16",
"name": "ejectableStakePercent",
"type": "uint16"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "registryCoordinator",
"outputs": [
{
"internalType": "contract IRegistryCoordinator",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "_ejector", "type": "address" },
{ "internalType": "bool", "name": "_status", "type": "bool" }
],
"name": "setEjector",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "uint8", "name": "_quorumNumber", "type": "uint8" },
{
"components": [
{
"internalType": "uint32",
"name": "rateLimitWindow",
"type": "uint32"
},
{
"internalType": "uint16",
"name": "ejectableStakePercent",
"type": "uint16"
}
],
"internalType": "struct IEjectionManager.QuorumEjectionParams",
"name": "_quorumEjectionParams",
"type": "tuple"
}
],
"name": "setQuorumEjectionParams",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "uint8", "name": "", "type": "uint8" },
{ "internalType": "uint256", "name": "", "type": "uint256" }
],
"name": "stakeEjectedForQuorum",
"outputs": [
{ "internalType": "uint256", "name": "timestamp", "type": "uint256" },
{ "internalType": "uint256", "name": "stakeEjected", "type": "uint256" }
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "stakeRegistry",
"outputs": [
{
"internalType": "contract IStakeRegistry",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "newOwner", "type": "address" }
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]
56 changes: 56 additions & 0 deletions subgraphs/eigenda-operator-state/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,62 @@ type NewPubkeyRegistration @entity(immutable: true) {
transactionHash: Bytes!
}

## EjectionManager

type EjectorUpdated @entity(immutable: true) {
id: Bytes!
ejector: Bytes! # address
status: Boolean! # bool
blockNumber: BigInt!
blockTimestamp: BigInt!
transactionHash: Bytes!
}

type Initialized @entity(immutable: true) {
id: Bytes!
version: Int! # uint8
blockNumber: BigInt!
blockTimestamp: BigInt!
transactionHash: Bytes!
}

type OperatorEjected @entity(immutable: true) {
id: Bytes!
operatorId: Bytes! # bytes32
quorumNumber: Int! # uint8
blockNumber: BigInt!
blockTimestamp: BigInt!
transactionHash: Bytes!
}

type OwnershipTransferred @entity(immutable: true) {
id: Bytes!
previousOwner: Bytes! # address
newOwner: Bytes! # address
blockNumber: BigInt!
blockTimestamp: BigInt!
transactionHash: Bytes!
}

type QuorumEjection @entity(immutable: true) {
id: Bytes!
ejectedOperators: BigInt! # uint32
ratelimitHit: Boolean! # bool
blockNumber: BigInt!
blockTimestamp: BigInt!
transactionHash: Bytes!
}

type QuorumEjectionParamsSet @entity(immutable: true) {
id: Bytes!
quorumNumber: Int! # uint8
rateLimitWindow: BigInt! # uint32
ejectableStakePercent: Int! # uint16
blockNumber: BigInt!
blockTimestamp: BigInt!
transactionHash: Bytes!
}

## Custom

type Operator @entity {
Expand Down
Loading

0 comments on commit f5a3c52

Please sign in to comment.