fix: RLN Merkle Root window

This commit is contained in:
Richard Ramos 2022-11-26 17:08:49 -04:00 committed by RichΛrd
parent a40db95987
commit 041c7be67d
3 changed files with 5 additions and 5 deletions

2
go.mod
View File

@ -32,7 +32,7 @@ require (
require (
github.com/gorilla/mux v1.8.0
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
golang.org/x/text v0.4.0
)

2
go.sum
View File

@ -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-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.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/go.mod h1:emThr8WZLeAtKqFW+/nXfHn9VucuXTh8aHap03UXP84=
github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee h1:lYbXeSvJi5zk5GLKVuid9TVjS9a0OmLIDKTfoZBL6Ow=

View File

@ -229,9 +229,7 @@ func (rln *WakuRLNRelay) ValidateMessage(msg *pb.WakuMessage, optionalTime *time
contentTopicBytes := []byte(msg.ContentTopic)
input := append(msg.Payload, contentTopicBytes...)
// TODO: set window of roots
roots := [][32]byte{}
valid, err := rln.RLN.VerifyWithRoots(input, *msgProof, roots)
valid, err := rln.RLN.VerifyWithRoots(input, *msgProof, rln.validMerkleRoots)
if err != nil {
rln.log.Debug("could not verify proof", zap.Error(err))
return MessageValidationResult_Invalid, nil
@ -312,7 +310,7 @@ func (r *WakuRLNRelay) MembershipContractAddress() common.Address {
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[:]))
// assuming all the members arrive in order
err := r.RLN.InsertMember(pubkey)