Record project continuation changes

This commit is contained in:
2026-05-12 21:02:29 +03:00
parent 3059d1d7a3
commit 8f69d53193
339 changed files with 101111 additions and 1769 deletions
@@ -34,12 +34,20 @@ func ValidateProductionEnvelope(local PeerIdentity, envelope ProductionEnvelope,
return err
}
}
if envelope.ChannelClass != ProductionChannelFabricControl {
maxPayloadBytes := MaxProductionEnvelopePayloadBytes
switch envelope.ChannelClass {
case ProductionChannelFabricControl:
if envelope.MessageType != ProductionMessageFabricControl {
return fmt.Errorf("%w: unsupported message_type", ErrForwardEnvelopeInvalid)
}
case ProductionChannelVPNPacket:
if envelope.MessageType != ProductionMessageVPNPacketBatch {
return fmt.Errorf("%w: unsupported message_type", ErrForwardEnvelopeInvalid)
}
maxPayloadBytes = MaxProductionVPNPacketPayloadBytes
default:
return ErrUnauthorizedChannel
}
if envelope.MessageType != ProductionMessageFabricControl {
return fmt.Errorf("%w: unsupported message_type", ErrForwardEnvelopeInvalid)
}
if envelope.TTL <= 0 {
return ErrTTLExhausted
}
@@ -58,8 +66,8 @@ func ValidateProductionEnvelope(local PeerIdentity, envelope ProductionEnvelope,
if envelope.PayloadLength != len(envelope.Payload) {
return fmt.Errorf("%w: payload_length mismatch", ErrForwardEnvelopeInvalid)
}
if envelope.PayloadLength > MaxProductionEnvelopePayloadBytes {
return fmt.Errorf("%w: payload exceeds fabric-control limit", ErrForwardEnvelopeInvalid)
if envelope.PayloadLength > maxPayloadBytes {
return fmt.Errorf("%w: payload exceeds channel limit", ErrForwardEnvelopeInvalid)
}
if envelope.PayloadHash == "" {
return fmt.Errorf("%w: payload_hash is required", ErrForwardEnvelopeInvalid)