Skip to content

Commit dcc826b

Browse files
committed
Fix is proposer check
The block parameter was broken and not supplied.
1 parent cef8e4d commit dcc826b

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

rolling-shutter/keyperimpl/gnosis/database/gnosiskeyper.sqlc.gen.go

Lines changed: 8 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rolling-shutter/keyperimpl/gnosis/database/sql/queries/gnosiskeyper.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ INSERT INTO validator_registrations (
9191

9292
-- name: IsValidatorRegistered :one
9393
SELECT is_registration FROM validator_registrations
94-
WHERE validator_index = $1 AND block_number < $1
94+
WHERE validator_index = $1 AND block_number < $2
9595
ORDER BY block_number DESC, tx_index DESC, log_index DESC
9696
LIMIT 1;
9797

rolling-shutter/keyperimpl/gnosis/newslot.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,10 @@ func (kpr *Keyper) isProposerRegistered(ctx context.Context, slot uint64) (bool,
128128
}
129129

130130
db := gnosisdatabase.New(kpr.dbpool)
131-
isRegistered, err := db.IsValidatorRegistered(ctx, int64(proposerDuty.ValidatorIndex))
131+
isRegistered, err := db.IsValidatorRegistered(ctx, gnosisdatabase.IsValidatorRegisteredParams{
132+
ValidatorIndex: int64(proposerDuty.ValidatorIndex),
133+
BlockNumber: int64(block),
134+
})
132135
if err == pgx.ErrNoRows {
133136
return false, nil
134137
}

0 commit comments

Comments
 (0)