Skip to content

Commit 890c68c

Browse files
committed
chore: remove code for contract address update
1 parent a076705 commit 890c68c

2 files changed

Lines changed: 27 additions & 77 deletions

File tree

CHANGELOG.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
11
# Changelog
22

3-
## [v1.2.5] - 2025-2-19
3+
## [v1.2.6] - 2026-3-?
4+
5+
### Added
6+
7+
- Automated releases in CI on github.
8+
9+
### Changed
10+
11+
- Added mutexes to fully avoid race conditions in round computations.
12+
13+
### Removed
14+
15+
- Code needed for Relay address changes.
16+
17+
## [v1.2.5] - 2026-2-19
418

519
### Changed
620

7-
- - Addressed change of Relay contract address on all chains.
21+
- Addressed change of Relay contract address on all chains.

client/collector/signingPolicy.go

Lines changed: 11 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -16,35 +16,6 @@ import (
1616
"gorm.io/gorm"
1717
)
1818

19-
var (
20-
RelayFlareOld = common.HexToAddress("0x57a4c3676d08Aa5d15410b5A6A80fBcEF72f3F45")
21-
RelayFlareNew = common.HexToAddress("0xCcF30790A93F15e24EB909548a2C58a9b0a7FBd4")
22-
23-
RelayCoston2Old = common.HexToAddress("0x97702e350CaEda540935d92aAf213307e9069784")
24-
RelayCoston2New = common.HexToAddress("0xa10B672D1c62e5457b17af63d4302add6A99d7dE")
25-
26-
RelaySongbirdOld = common.HexToAddress("0x67a916E175a2aF01369294739AA60dDdE1Fad189")
27-
RelaySongbirdNew = common.HexToAddress("0xCB86E8Be709001e01897Bf59847406853da8f14b")
28-
29-
RelayCostonOld = common.HexToAddress("0x92a6E1127262106611e1e129BB64B6D8654273F7")
30-
RelayCostonNew = common.HexToAddress("0x051f214D346Cfd97B107BECb87E2B35D1b4287E9")
31-
)
32-
33-
func RequiresNewRelayAddress(address common.Address) (bool, common.Address) {
34-
switch address {
35-
case RelayFlareOld:
36-
return true, RelayFlareNew
37-
case RelayCoston2Old:
38-
return true, RelayCoston2New
39-
case RelaySongbirdOld:
40-
return true, RelaySongbirdNew
41-
case RelayCostonOld:
42-
return true, RelayCostonNew
43-
default:
44-
return false, address
45-
}
46-
}
47-
4819
// SigningPolicyInitializedListener initiates a channel that serves signingPolicyInitialized events emitted by relayContractAddress.
4920
func SigningPolicyInitializedListener(
5021
ctx context.Context,
@@ -60,46 +31,24 @@ func SigningPolicyInitializedListener(
6031
Number: 3,
6132
}
6233

63-
allLogs := make([]database.Log, 0, 3)
64-
65-
if requires, newAddress := RequiresNewRelayAddress(relayContractAddress); requires {
66-
params.Address = newAddress
67-
68-
newLogs, err := database.FetchLatestLogsByAddressAndTopic0(
69-
ctx, db, params,
70-
)
71-
if err != nil {
72-
logger.Panic("error fetching initial logs new:", err)
73-
}
74-
75-
allLogs = append(allLogs, newLogs...)
76-
}
77-
78-
if len(allLogs) < 3 {
79-
params.Address = relayContractAddress
80-
params.Number = 3 - len(allLogs)
81-
82-
logs, err := database.FetchLatestLogsByAddressAndTopic0(
83-
ctx, db, params,
84-
)
85-
if err != nil {
86-
logger.Panic("error fetching initial logs:", err)
87-
}
88-
89-
allLogs = append(allLogs, logs...)
34+
logs, err := database.FetchLatestLogsByAddressAndTopic0(
35+
ctx, db, params,
36+
)
37+
if err != nil {
38+
logger.Panic("error fetching initial logs:", err)
9039
}
9140

9241
latestQuery := time.Now()
93-
logger.Debug("Logs length:", len(allLogs))
94-
if len(allLogs) == 0 {
42+
logger.Debug("Logs length:", len(logs))
43+
if len(logs) == 0 {
9544
logger.Panic("No initial signing policies found:")
9645
}
9746

9847
// signingPolicyStorage expects policies in increasing order
99-
sorted := make([]shared.VotersData, 0, len(allLogs))
48+
sorted := make([]shared.VotersData, 0, len(logs))
10049

101-
for i := range allLogs {
102-
votersData, err := AddSubmitAddressesToSigningPolicy(ctx, db, registryContractAddress, allLogs[len(allLogs)-i-1])
50+
for i := range logs {
51+
votersData, err := AddSubmitAddressesToSigningPolicy(ctx, db, registryContractAddress, logs[len(logs)-i-1])
10352
if err != nil {
10453
logger.Panic("error fetching initial signing policies with submit addresses:", err)
10554
}
@@ -114,7 +63,7 @@ func SigningPolicyInitializedListener(
11463
logger.Info("SigningPolicyInitializedListener exiting:", ctx.Err())
11564
}
11665

117-
spiTargetedListener(ctx, db, relayContractAddress, registryContractAddress, allLogs[0], latestQuery, votersDataChan)
66+
spiTargetedListener(ctx, db, relayContractAddress, registryContractAddress, logs[0], latestQuery, votersDataChan)
11867
}
11968

12069
// spiTargetedListener that only starts aggressive queries for new signingPolicyInitialized events a bit before the expected emission and stops once it gets one and waits until the next window.
@@ -202,19 +151,6 @@ func queryNextSPI(
202151
return nil, err
203152
}
204153

205-
if requires, newAddress := RequiresNewRelayAddress(relayContractAddress); requires {
206-
params.Address = newAddress
207-
208-
newLogs, err := database.FetchLogsByAddressAndTopic0Timestamp(
209-
ctx, db, params,
210-
)
211-
if err != nil {
212-
return nil, err
213-
}
214-
215-
logs = append(logs, newLogs...)
216-
}
217-
218154
if len(logs) > 0 {
219155
votersDataArray := make([]shared.VotersData, 0)
220156
if len(logs) > 1 {

0 commit comments

Comments
 (0)