mirror of https://github.com/status-im/go-waku.git
fix: RLN Merkle Root window
This commit is contained in:
parent
a40db95987
commit
041c7be67d
2
go.mod
2
go.mod
|
@ -32,7 +32,7 @@ require (
|
||||||
require (
|
require (
|
||||||
github.com/gorilla/mux v1.8.0
|
github.com/gorilla/mux v1.8.0
|
||||||
github.com/waku-org/go-discover v0.0.0-20221027130446-2f43d5f6c73f
|
github.com/waku-org/go-discover v0.0.0-20221027130446-2f43d5f6c73f
|
||||||
github.com/waku-org/go-zerokit-rln v0.1.6
|
github.com/waku-org/go-zerokit-rln v0.1.7-wakuorg
|
||||||
github.com/waku-org/noise v1.0.2
|
github.com/waku-org/noise v1.0.2
|
||||||
golang.org/x/text v0.4.0
|
golang.org/x/text v0.4.0
|
||||||
)
|
)
|
||||||
|
|
2
go.sum
2
go.sum
|
@ -1520,6 +1520,8 @@ github.com/waku-org/go-discover v0.0.0-20221027130446-2f43d5f6c73f h1:YHIrSqs8Ao
|
||||||
github.com/waku-org/go-discover v0.0.0-20221027130446-2f43d5f6c73f/go.mod h1:eBHgM6T4EG0RZzxpxKy+rGz/6Dw2Nd8DWxS0lm9ESDw=
|
github.com/waku-org/go-discover v0.0.0-20221027130446-2f43d5f6c73f/go.mod h1:eBHgM6T4EG0RZzxpxKy+rGz/6Dw2Nd8DWxS0lm9ESDw=
|
||||||
github.com/waku-org/go-zerokit-rln v0.1.6 h1:r8B6S83WJIioxEj1wSruhx+eg47HpSrIwuhi6yaRvy0=
|
github.com/waku-org/go-zerokit-rln v0.1.6 h1:r8B6S83WJIioxEj1wSruhx+eg47HpSrIwuhi6yaRvy0=
|
||||||
github.com/waku-org/go-zerokit-rln v0.1.6/go.mod h1:T1wLR/VuTcxLkDv0O7JvR0N/9y7GHM2IeU7LjnWZxek=
|
github.com/waku-org/go-zerokit-rln v0.1.6/go.mod h1:T1wLR/VuTcxLkDv0O7JvR0N/9y7GHM2IeU7LjnWZxek=
|
||||||
|
github.com/waku-org/go-zerokit-rln v0.1.7-wakuorg h1:2vVIBCtBih2w1K9ll8YnToTDZvbxcgbsClsPlJS/kkg=
|
||||||
|
github.com/waku-org/go-zerokit-rln v0.1.7-wakuorg/go.mod h1:GlyaVeEWNEBxVJrWC6jFTvb4LNb9d9qnjdS6EiWVUvk=
|
||||||
github.com/waku-org/noise v1.0.2 h1:7WmlhpJ0eliBzwzKz6SoTqQznaEU2IuebHF3oCekqqs=
|
github.com/waku-org/noise v1.0.2 h1:7WmlhpJ0eliBzwzKz6SoTqQznaEU2IuebHF3oCekqqs=
|
||||||
github.com/waku-org/noise v1.0.2/go.mod h1:emThr8WZLeAtKqFW+/nXfHn9VucuXTh8aHap03UXP84=
|
github.com/waku-org/noise v1.0.2/go.mod h1:emThr8WZLeAtKqFW+/nXfHn9VucuXTh8aHap03UXP84=
|
||||||
github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee h1:lYbXeSvJi5zk5GLKVuid9TVjS9a0OmLIDKTfoZBL6Ow=
|
github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee h1:lYbXeSvJi5zk5GLKVuid9TVjS9a0OmLIDKTfoZBL6Ow=
|
||||||
|
|
|
@ -229,9 +229,7 @@ func (rln *WakuRLNRelay) ValidateMessage(msg *pb.WakuMessage, optionalTime *time
|
||||||
contentTopicBytes := []byte(msg.ContentTopic)
|
contentTopicBytes := []byte(msg.ContentTopic)
|
||||||
input := append(msg.Payload, contentTopicBytes...)
|
input := append(msg.Payload, contentTopicBytes...)
|
||||||
|
|
||||||
// TODO: set window of roots
|
valid, err := rln.RLN.VerifyWithRoots(input, *msgProof, rln.validMerkleRoots)
|
||||||
roots := [][32]byte{}
|
|
||||||
valid, err := rln.RLN.VerifyWithRoots(input, *msgProof, roots)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
rln.log.Debug("could not verify proof", zap.Error(err))
|
rln.log.Debug("could not verify proof", zap.Error(err))
|
||||||
return MessageValidationResult_Invalid, nil
|
return MessageValidationResult_Invalid, nil
|
||||||
|
@ -312,7 +310,7 @@ func (r *WakuRLNRelay) MembershipContractAddress() common.Address {
|
||||||
return r.membershipContractAddress
|
return r.membershipContractAddress
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *WakuRLNRelay) insertMember(pubkey [32]byte) error {
|
func (r *WakuRLNRelay) insertMember(pubkey r.IDCommitment) error {
|
||||||
r.log.Debug("a new key is added", zap.Binary("pubkey", pubkey[:]))
|
r.log.Debug("a new key is added", zap.Binary("pubkey", pubkey[:]))
|
||||||
// assuming all the members arrive in order
|
// assuming all the members arrive in order
|
||||||
err := r.RLN.InsertMember(pubkey)
|
err := r.RLN.InsertMember(pubkey)
|
||||||
|
|
Loading…
Reference in New Issue