Add NIP-11 relay synchronization and group management features
Some checks failed
Go / build (push) Has been cancelled
Go / release (push) Has been cancelled

- Introduced a new `sync` package for managing NIP-11 relay information and relay group configurations.
- Implemented a cache for NIP-11 documents, allowing retrieval of relay public keys and authoritative configurations.
- Enhanced the sync manager to update peer lists based on authoritative configurations from relay group events.
- Updated event handling to incorporate policy checks during event imports, ensuring compliance with relay rules.
- Refactored various components to utilize the new `sha256-simd` package for improved performance.
- Added comprehensive tests to validate the new synchronization and group management functionalities.
- Bumped version to v0.24.1 to reflect these changes.
This commit is contained in:
2025-11-03 18:17:15 +00:00
parent e161d0e4be
commit e56bf76257
83 changed files with 3712 additions and 7417 deletions

View File

@@ -9,7 +9,7 @@ import (
"lol.mleku.dev/log"
"next.orly.dev/pkg/crypto/ec/bech32"
"next.orly.dev/pkg/crypto/ec/schnorr"
"next.orly.dev/pkg/crypto/sha256"
"github.com/minio/sha256-simd"
"next.orly.dev/pkg/encoders/bech32encoding/pointers"
"next.orly.dev/pkg/encoders/bech32encoding/tlv"
"next.orly.dev/pkg/encoders/hex"

View File

@@ -9,7 +9,7 @@ import (
"lol.mleku.dev/chk"
"lol.mleku.dev/errorf"
"lol.mleku.dev/log"
"next.orly.dev/pkg/crypto/sha256"
"github.com/minio/sha256-simd"
"next.orly.dev/pkg/encoders/envelopes"
"next.orly.dev/pkg/encoders/hex"
"next.orly.dev/pkg/encoders/text"

View File

@@ -5,7 +5,7 @@ import (
"lol.mleku.dev/chk"
"lukechampine.com/frand"
"next.orly.dev/pkg/crypto/sha256"
"github.com/minio/sha256-simd"
"next.orly.dev/pkg/encoders/envelopes"
"next.orly.dev/pkg/encoders/envelopes/messages"
"next.orly.dev/pkg/utils"

View File

@@ -1,7 +1,7 @@
package event
import (
"next.orly.dev/pkg/crypto/sha256"
"github.com/minio/sha256-simd"
"next.orly.dev/pkg/encoders/hex"
"next.orly.dev/pkg/encoders/ints"
"next.orly.dev/pkg/encoders/text"

View File

@@ -9,7 +9,7 @@ import (
"lol.mleku.dev/errorf"
"lol.mleku.dev/log"
"next.orly.dev/pkg/crypto/ec/schnorr"
"next.orly.dev/pkg/crypto/sha256"
"github.com/minio/sha256-simd"
"next.orly.dev/pkg/encoders/ints"
"next.orly.dev/pkg/encoders/kind"
"next.orly.dev/pkg/encoders/tag"

View File

@@ -5,7 +5,7 @@ import (
"time"
p256k1signer "p256k1.mleku.dev/signer"
"next.orly.dev/pkg/crypto/sha256"
"github.com/minio/sha256-simd"
"next.orly.dev/pkg/encoders/event"
"next.orly.dev/pkg/encoders/hex"
"next.orly.dev/pkg/encoders/kind"

View File

@@ -7,7 +7,7 @@ import (
"lol.mleku.dev/chk"
"lol.mleku.dev/errorf"
"next.orly.dev/pkg/crypto/ec/schnorr"
"next.orly.dev/pkg/crypto/sha256"
"github.com/minio/sha256-simd"
"next.orly.dev/pkg/encoders/event"
"next.orly.dev/pkg/encoders/ints"
"next.orly.dev/pkg/encoders/kind"

View File

@@ -7,7 +7,7 @@ import (
"lukechampine.com/frand"
"next.orly.dev/pkg/crypto/ec/schnorr"
"next.orly.dev/pkg/crypto/ec/secp256k1"
"next.orly.dev/pkg/crypto/sha256"
"github.com/minio/sha256-simd"
"next.orly.dev/pkg/encoders/hex"
"next.orly.dev/pkg/encoders/kind"
"next.orly.dev/pkg/encoders/tag"

View File

@@ -271,6 +271,7 @@ var (
PublicChatsList = &K{10005}
BlockedRelaysList = &K{10006}
SearchRelaysList = &K{10007}
RelayGroupConfig = &K{10008}
InterestsList = &K{10015}
UserEmojiList = &K{10030}
DMRelaysList = &K{10050}
@@ -402,6 +403,7 @@ var Map = map[uint16]string{
PublicChatsList.K: "Public Chats list",
BlockedRelaysList.K: "Blocked Relays list",
SearchRelaysList.K: "Search Relays list",
RelayGroupConfig.K: "Relay Group Configuration",
InterestsList.K: "Interests",
UserEmojiList.K: "User Emoji list",
DMRelaysList.K: "DM relays",

View File

@@ -4,7 +4,7 @@ import (
"testing"
"lukechampine.com/frand"
"next.orly.dev/pkg/crypto/sha256"
"github.com/minio/sha256-simd"
"next.orly.dev/pkg/encoders/hex"
)

View File

@@ -5,7 +5,7 @@ import (
"lol.mleku.dev/chk"
"lukechampine.com/frand"
"next.orly.dev/pkg/crypto/sha256"
"github.com/minio/sha256-simd"
)
func TestUnescapeByteString(t *testing.T) {

View File

@@ -5,7 +5,7 @@ import (
"lol.mleku.dev/chk"
"lukechampine.com/frand"
"next.orly.dev/pkg/crypto/sha256"
"github.com/minio/sha256-simd"
"next.orly.dev/pkg/encoders/hex"
"next.orly.dev/pkg/utils"
)