Skip to content

Commit c9a0e18

Browse files
committed
Update RSKIP529 with base and super events storage specification
1 parent 3759301 commit c9a0e18

File tree

2 files changed

+57
-26
lines changed

2 files changed

+57
-26
lines changed

IPs/RSKIP529.md

Lines changed: 56 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
rskip: 529
3-
title: Super events
3+
title: New storage cells in Bridge native contract for base and super events info
44
created: 26-AUG-25
55
author: MI
66
purpose: Sca
@@ -30,75 +30,106 @@ To be completed...
3030

3131
## Specification
3232

33-
### 1. New storage entry for the serialized `super event`
33+
### 1. Base event
3434

35-
A new storage entry is necessary to store the serialized `super event` sent by the Union Bridge contract.
35+
#### 1.1 New storage entry for the serialized `base event`
36+
37+
A new storage entry is necessary to store the serialized `base event` sent by the Union Bridge contract.
3638

3739
```
38-
**Storage entry name:** `superEvent`
40+
**Storage entry name:** `baseEvent`
3941
4042
**Data type:** `bytes`
4143
42-
**Maximum size:** TBD
44+
**Maximum size:** 128 bytes
4345
```
4446

45-
The value is considered *unset* if `superEvent.length == 0`.
47+
#### 1.2. Method to get the serialized `base event`
4648

47-
### 2. Method to get the serialized `super event`
48-
49-
A method will be added to allow anyone to query the current `super event`. If no value is set, then it should return an empty array of bytes.
49+
A method will be added to allow anyone to query the current `base event`. If no value is set, then it should return an empty array of bytes.
5050

5151
**Method signature:**
5252

5353
```
54-
function getSuperEvent() public view returns (bytes memory);
54+
function getBaseEvent() public view returns (bytes memory);
5555
```
5656

57-
### 3. Method to set the `super event` value in storage
57+
#### 1.3. Method to set the `base event` value in storage
5858

59-
A method will be added to allow the Union Bridge contract address to set the current `super event` value in storage.
59+
A method will be added to allow the Union Bridge contract address to set the current `base event` value in storage.
6060

6161
- If the caller is not the Union Bridge contract address then it should revert.
62-
- It should receive a non-empty array of bytes and store it under the `superEvent` storage key of the Bridge contract.
63-
- If there is an already existing value under the `superEvent` storage key of the Bridge contract, it will be overriden by the new value.
62+
- It should receive a non-empty array of bytes whose length is at most 128 bytes, which it then stores under the `baseEvent` storage key of the Bridge contract.
63+
- If there is an already existing value under the `baseEvent` storage key of the Bridge contract, it will be overriden by the new value.
6464

6565
**Method signature:**
6666

6767
```
68-
function setSuperEvent(bytes memory superEvent) public;
68+
function setBaseEvent(bytes memory baseEvent) public;
6969
```
7070

71-
### 4. Method to clear the `super event` value in storage
71+
#### 1.4. Method to clear the `base event` value in storage
7272

73-
A method will be added to allow the Union Bridge contract address to clear the current `super event` value in storage.
73+
A method will be added to allow the Union Bridge contract address to clear the current `base event` value in storage.
7474

7575
- If the caller is not the Union Bridge contract address then it should revert.
76-
- It should store an empty byte array under the `superEvent` storage key of the Bridge, overriding whatever value was previously there.
76+
- It should store an empty byte array under the `baseEvent` storage key of the Bridge, overriding whatever value was previously there.
7777

7878
**Method signature:**
7979

8080
```
81-
function clearSuperEvent() public;
81+
function clearBaseEvent() public;
82+
```
83+
84+
### 2. Super event
85+
86+
#### 2.1 New storage entry for the serialized `super event`
87+
88+
A new storage entry is necessary to store the serialized `super event` sent by the Union Bridge contract.
89+
90+
```
91+
**Storage entry name:** `superEvent`
92+
93+
**Data type:** `bytes`
94+
95+
**Maximum size:** 128 bytes
8296
```
8397

84-
### 5. Method to get the accumulated difficulty of the latest `super block`
98+
#### 2.2. Method to get the serialized `super event`
8599

86-
A method will be added to allow anyone to query the latest `super block` accumulated difficulty.
100+
A method will be added to allow anyone to query the current `super event`. If no value is set, then it should return an empty array of bytes.
87101

88102
**Method signature:**
89103

90104
```
91-
function getSuperBlockCumulativeDifficulty() public view returns(bytes);
105+
function getSuperEvent() public view returns (bytes memory);
92106
```
93107

94-
### 6. Method to get the latest `super block` chain height
108+
#### 2.3. Method to set the `super event` value in storage
95109

96-
A method will be added to allow anyone to query the latest `super block` chain height.
110+
A method will be added to allow the Union Bridge contract address to set the current `super event` value in storage.
111+
112+
- If the caller is not the Union Bridge contract address then it should revert.
113+
- It should receive a non-empty array of bytes whose length is at most 128 bytes, which it then stores under the `superEvent` storage key of the Bridge contract.
114+
- If there is an already existing value under the `superEvent` storage key of the Bridge contract, it will be overriden by the new value.
97115

98116
**Method signature:**
99117

100118
```
101-
function getSuperBlockchainHeight() public view returns(uint32);
119+
function setSuperEvent(bytes memory superEvent) public;
120+
```
121+
122+
#### 2.4. Method to clear the `super event` value in storage
123+
124+
A method will be added to allow the Union Bridge contract address to clear the current `super event` value in storage.
125+
126+
- If the caller is not the Union Bridge contract address then it should revert.
127+
- It should store an empty byte array under the `superEvent` storage key of the Bridge, overriding whatever value was previously there.
128+
129+
**Method signature:**
130+
131+
```
132+
function clearSuperEvent() public;
102133
```
103134

104135
## Rationale

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ You can find an easily browseable version of this information [here](https://ips
246246
| 516 |[Precompiled contracts for +/* on Secp256k1](IPs/RSKIP516.md)| 10-APR-2025 | SDL | Usa | Core | 2 | Draft |
247247
| 517 |[Block time-centric difficulty adjustment with uncle threshold](IPs/RSKIP517.md)| 29-MAY-2025 | PDG | Sec,Sca | Core | 1 | Draft |
248248
| 518 |[Network Upgrade: Reed](IPs/RSKIP518.md)| 13-JUN-2025 | AE | Usa, Sca | Core | 3 | Draft |
249-
| 519 |[Super events](IPs/RSKIP519.md)| 26-AUG-2025 | MI | Sca | Core | 1 | Draft |
249+
| 519 |[New storage cells in Bridge native contract for base and super events info](IPs/RSKIP519.md)| 26-AUG-2025 | MI | Sca | Core | 1 | Draft |
250250

251251
(*) Under evaluation to be implemented in the next reference client release
252252

0 commit comments

Comments
 (0)