Skip to content

Commit

Permalink
Adds missing AllowedPeekerAny checks (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruteri authored Oct 30, 2023
1 parent 9b0b88b commit e600fd8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion suave/core/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/ethereum/go-ethereum/node"
)

var AllowedPeekerAny = common.HexToAddress("0x04994f67dc55b09e814ab7ffc8df3686b4afb2bb53e60eae97ef043fe03fb829") // "*"
var AllowedPeekerAny = common.HexToAddress("0xC8df3686b4Afb2BB53e60EAe97EF043FE03Fb829") // "*"

type Bytes = hexutil.Bytes
type BidId = types.BidId
Expand Down
2 changes: 1 addition & 1 deletion suave/cstore/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ func (e *ConfidentialStoreEngine) NewMessage(message DAMessage) error {
return fmt.Errorf("confidential engine: sw signer %x not allowed to store on bid %x", recoveredMessageSigner, sw.Bid.Id)
}

if !slices.Contains(sw.Bid.AllowedPeekers, sw.Caller) {
if !slices.Contains(sw.Bid.AllowedPeekers, sw.Caller) && !slices.Contains(sw.Bid.AllowedPeekers, suave.AllowedPeekerAny) {
return fmt.Errorf("confidential engine: caller %x not allowed on bid %x", sw.Caller, sw.Bid.Id)
}

Expand Down
2 changes: 1 addition & 1 deletion suave/cstore/transactional_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (s *TransactionalStore) Store(bidId suave.BidId, caller common.Address, key
return suave.Bid{}, err
}

if !slices.Contains(bid.AllowedPeekers, caller) {
if !slices.Contains(bid.AllowedPeekers, caller) && !slices.Contains(bid.AllowedPeekers, suave.AllowedPeekerAny) {
return suave.Bid{}, fmt.Errorf("confidential store transaction: %x not allowed to store %s on %x", caller, key, bidId)
}

Expand Down

0 comments on commit e600fd8

Please sign in to comment.