Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document caveat in Redis storage #1760

Merged
merged 1 commit into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions arbnode/dataposter/data_poster.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ type queuedTransaction[Meta any] struct {
NextReplacement time.Time
}

// Note: one of the implementation of this interface (Redis storage) does not
// support duplicate values.
type QueueStorage[Item any] interface {
GetContents(ctx context.Context, startingIndex uint64, maxResults uint64) ([]*Item, error)
GetLast(ctx context.Context) (*Item, error)
Expand Down
5 changes: 4 additions & 1 deletion arbnode/dataposter/redis/redisstorage.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ import (
"github.com/offchainlabs/nitro/util/signature"
)

// Storage requires that Item is RLP encodable/decodable
// Storage implements redis sorted set backed storage. It does not support
// duplicate keys or values. That is, putting the same element on different
// indexes will not yield expected behavior.
// More at: https://redis.io/commands/zadd/.
type Storage[Item any] struct {
client redis.UniversalClient
signer *signature.SimpleHmac
Expand Down