TopAccesses — Most Accessed Accounts and Storage Slots
Subscribe
{"subscribe": ["TopAccesses"]}
Message Format
{
"seq": 45,
"TopAccesses": {
"account": [
{"key": "0x1234...abcd", "count": 15234},
{"key": "0x5678...ef01", "count": 8921}
],
"storage": [
{"key": ["0x1234...abcd", "0xabcd...1234"], "count": 5432},
{"key": ["0x5678...ef01", "0x0000...0001"], "count": 3210}
]
}
}
Fields
account[]
| Field | Type | Description |
|---|---|---|
key | string | Account address |
count | number | Number of accesses |
storage[]
| Field | Type | Description |
|---|---|---|
key | [string, string] | Tuple [contract_address, storage_slot] |
count | number | Number of accesses |
Description
TopAccesses uses the Space-Saving algorithm to efficiently track the most frequently accessed accounts and storage slots.
- Lists are sorted by
count(descending) - Data resets periodically
- Useful for identifying hot spots in storage
Usage Example
{"subscribe": ["TopAccesses"]}
ws.onmessage = (event) => {
const msg = JSON.parse(event.data);
if (msg.top-accesses) {
console.log("Top accounts:");
for (const a of msg.TopAccesses.account.slice(0, 5)) {
console.log(` ${a.key}: ${a.count} accesses`);
}
console.log("Top storage slots:");
for (const s of msg.TopAccesses.storage.slice(0, 5)) {
console.log(` ${s.key[0]}[${s.key[1]}]: ${s.count} accesses`);
}
}
};
Frequency
Periodic (not tied to blocks). Significantly less frequent than other metrics.