Skip to content

Commit f77d509

Browse files
authored
cleanup: remove handling of SigningMarshaler from f3 (#923)
Signed-off-by: Jakub Sztandera <[email protected]>
1 parent c64e212 commit f77d509

File tree

3 files changed

+3
-15
lines changed

3 files changed

+3
-15
lines changed

cmd/f3/run.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,3 @@ func setupDiscovery(h host.Host) (closer func(), err error) {
193193
type fakeSigner struct {
194194
signing.FakeBackend
195195
}
196-
197-
// MarshalPayloadForSigning marshals the given payload into the bytes that should be signed.
198-
// This should usually call `Payload.MarshalForSigning(NetworkName)` except when testing as
199-
// that method is slow (computes a merkle tree that's necessary for testing).
200-
// Implementations must be safe for concurrent use.
201-
func (fs *fakeSigner) MarshalPayloadForSigning(nn gpbft.NetworkName, p *gpbft.Payload) []byte {
202-
return p.MarshalForSigning(nn)
203-
}

gpbft/api.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ type SigningMarshaler interface {
128128
// This should usually call `Payload.MarshalForSigning(NetworkName)` except when testing as
129129
// that method is slow (computes a merkle tree that's necessary for testing).
130130
// Implementations must be safe for concurrent use.
131+
// WARNING: the partial message code depends on the structure of signed payload
131132
MarshalPayloadForSigning(NetworkName, *Payload) []byte
132133
}
133134

host.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -838,14 +838,9 @@ func (h *gpbftHost) saveDecision(decision *gpbft.Justification) (*certs.Finality
838838
}
839839

840840
// MarshalPayloadForSigning marshals the given payload into the bytes that should be signed.
841-
// This should usually call `Payload.MarshalForSigning(NetworkName)` except when testing as
842-
// that method is slow (computes a merkle tree that's necessary for testing).
841+
// This calls `Payload.MarshalForSigning(NetworkName)`
843842
func (h *gpbftHost) MarshalPayloadForSigning(nn gpbft.NetworkName, p *gpbft.Payload) []byte {
844-
if m, ok := h.verifier.(gpbft.SigningMarshaler); ok {
845-
return m.MarshalPayloadForSigning(nn, p)
846-
} else {
847-
return p.MarshalForSigning(nn)
848-
}
843+
return p.MarshalForSigning(nn)
849844
}
850845

851846
// Verifies a signature for the given public key.

0 commit comments

Comments
 (0)