Skip to content

Commit a791b2a

Browse files
add config setting
1 parent da89c96 commit a791b2a

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

relayer/relays/beefy/config.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ type SourceConfig struct {
1515
FastForwardDepth uint64 `mapstructure:"fast-forward-depth"`
1616
// Period to sample the beefy updates (in number of blocks)
1717
UpdatePeriod uint64 `mapstructure:"update-period"`
18+
// Only submit mandatory commitments. The first commitment for each session which validators must sign.
19+
DiscardNonMandatoryCommitments bool `mapstructure:"discard-non-mandatory-commitments"`
1820
}
1921

2022
type SinkConfig struct {

relayer/relays/beefy/polkadot-listener.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ func (li *PolkadotListener) scanCommitments(
103103
"lastSyncedBeefyBlock": lastSyncedBeefyBlock,
104104
})
105105

106+
if li.config.DiscardNonMandatoryCommitments && !result.IsMandatory {
107+
logEntry.Info("Discarded due to not being a mandatory commitment.")
108+
continue
109+
}
110+
106111
validators, err := li.queryBeefyAuthorities(result.BlockHash)
107112
if err != nil {
108113
return fmt.Errorf("fetch beefy authorities at block %v: %w", result.BlockHash, err)

web/packages/test/config/beefy-relay.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
},
66
"beefy-activation-block": 0,
77
"fast-forward-depth": 20,
8-
"update-period": 0
8+
"update-period": 0,
9+
"discard-non-mandatory-commitments": false
910
},
1011
"sink": {
1112
"ethereum": {

0 commit comments

Comments
 (0)