Skip to content

Commit 78b4466

Browse files
committed
Add pre-release key generation hack
This should be reverted some time next week.
1 parent 7a02570 commit 78b4466

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

rolling-shutter/keyperimpl/gnosis/newslot.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"math"
99
"math/big"
1010
"sort"
11+
"time"
1112

1213
"github.com/ethereum/go-ethereum/common"
1314
"github.com/jackc/pgx/v4"
@@ -95,7 +96,11 @@ func (kpr *Keyper) maybeTriggerDecryption(ctx context.Context, slot uint64) erro
9596
Uint64("slot", slot).
9697
Uint64("proposer-index", proposerIndex).
9798
Msg("skipping slot as proposer is not registered")
98-
return nil
99+
if kpr.isPreRelease() {
100+
log.Info().Msg("scratch that, generating key anyway because we're in pre-release mode")
101+
} else {
102+
return nil
103+
}
99104
}
100105

101106
// For each block with a proposer, the tx pointer age has to be incremented. If keys for
@@ -158,6 +163,11 @@ func (kpr *Keyper) isProposerRegistered(ctx context.Context, slot uint64, block
158163
return isRegistered, proposerDuty.ValidatorIndex, nil
159164
}
160165

166+
func (kpr *Keyper) isPreRelease() bool {
167+
return (kpr.config.InstanceID == 1000 &&
168+
time.Now().Before(time.Date(2024, 7, 7, 23, 59, 59, 0, time.UTC)))
169+
}
170+
161171
func getTxPointer(ctx context.Context, db *pgxpool.Pool, eon int64, maxTxPointerAge int64) (int64, error) {
162172
gnosisKeyperDB := gnosisdatabase.New(db)
163173
var txPointer int64

0 commit comments

Comments
 (0)