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

Skeleton and basic tests for confidential store engine #25

Merged
merged 30 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
3c9622e
Skeleton and basic tests for confidential store engine
Ruteri Sep 6, 2023
c3fad36
Adds bid creation tx, bid signatures, message signatures
Ruteri Sep 7, 2023
2431d70
Adjusts lifecycle to match geths, adds redis configs
Ruteri Sep 8, 2023
762267d
Adds keystore-based message signer
Ruteri Sep 12, 2023
2c207e5
Adds a devnet setup for the redis-based confidential store transport
Ruteri Sep 12, 2023
e71cb0e
Adjusts DA signer, adds allowed stores to newBid in bundles and share…
Ruteri Sep 14, 2023
2079fa9
Merge with upstream
Ruteri Sep 15, 2023
9b8326b
Splits the 32byte BidId into salt+hash
Ruteri Sep 15, 2023
09195e1
Split docker composes
Ruteri Sep 15, 2023
2be0294
Merge upstream, minor cleanup
Ruteri Sep 15, 2023
d8d0095
Simplifies store backend, moves all store related validation logic to…
Ruteri Sep 15, 2023
975de6a
Refactors how suave stuff is handled in EVM interpreter
Ruteri Sep 15, 2023
05e2d95
Update go.mod
Ruteri Sep 15, 2023
cc5cee1
Removes docker multinode setup
Ruteri Sep 18, 2023
9e5fc0b
Simplify redis setup in e2e test framework
Ruteri Sep 18, 2023
4f8da84
Adjuts how context is handled in store transport implementation
Ruteri Sep 18, 2023
2b4b42e
Increase store TTL to 24 hours
Ruteri Sep 18, 2023
003ee94
Confidential Engine: drop messages originating from itself
Ruteri Sep 18, 2023
d42cde1
Renames pubsub to transport topic
Ruteri Sep 18, 2023
391355d
Makes linter happy and adjusts devenv scripts
Ruteri Sep 18, 2023
e88250d
Increases timeouts in redis tests
Ruteri Sep 18, 2023
c054246
Updates go.mod
Ruteri Sep 18, 2023
83337a8
Upgrades flashbots/go-utils and its dependencies
Ruteri Sep 19, 2023
9e854f6
Updates README.md with changes to Confidential Store
Ruteri Sep 19, 2023
349a8ed
Adjust error handling in Stop() functions
Ruteri Sep 19, 2023
055223b
Reuse redis key format in miniredis
Ruteri Sep 19, 2023
df75400
Removes panic from miniredis Publish
Ruteri Sep 19, 2023
9d7c65e
Updates README
Ruteri Sep 19, 2023
3fe0fac
Merge upstream
Ruteri Sep 28, 2023
2d250a4
Add note on redis being temporary
Ruteri Sep 28, 2023
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 .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
build/_workspace
build/_bin
tests/testdata

suave/devenv
metachris marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ devtools:
@type "solc" 2> /dev/null || echo 'Please install solc'
@type "protoc" 2> /dev/null || echo 'Please install protoc'

suavedevtools:
./suave/scripts/contracts.sh build
go run ./suave/gen/main.go -write

devnet-up:
docker-compose -f ./suave/devenv/docker-compose.yml up -d --build

Expand Down
2 changes: 2 additions & 0 deletions cmd/geth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ var (

suaveFlags = []cli.Flag{
utils.SuaveEthRemoteBackendEndpointFlag,
utils.SuaveConfidentialPubsubRedisEndpointFlag,
utils.SuaveConfidentialStoreRedisEndpointFlag,
}
)

Expand Down
20 changes: 20 additions & 0 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,18 @@ var (
Category: flags.SuaveCategory,
}

SuaveConfidentialPubsubRedisEndpointFlag = &cli.StringFlag{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the difference between these two flags? Could they be merged?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They can't be merged - one is the backed for storing data (redis owned by whoever is running the node), and the other is a transport layer - owned by whoever is trusted to run the pubsub. Those are two different redis instances, the transport one is shared among multiple nodes

Name: "suave.confidential.redis-pubsub-endpoint",
Usage: "Redis endpoint to use as confidential store transport (default: no transport)",
Category: flags.SuaveCategory,
}

SuaveConfidentialStoreRedisEndpointFlag = &cli.StringFlag{
Name: "suave.confidential.redis-store-endpoint",
Usage: "Redis endpoint to use as confidential storage backend (default: local store)",
Category: flags.SuaveCategory,
}

// Account settings
UnlockedAccountFlag = &cli.StringFlag{
Name: "unlock",
Expand Down Expand Up @@ -1648,6 +1660,14 @@ func SetSuaveConfig(ctx *cli.Context, stack *node.Node, cfg *suave.Config) {
if ctx.IsSet(SuaveEthRemoteBackendEndpointFlag.Name) {
cfg.SuaveEthRemoteBackendEndpoint = ctx.String(SuaveEthRemoteBackendEndpointFlag.Name)
}

if ctx.IsSet(SuaveConfidentialPubsubRedisEndpointFlag.Name) {
cfg.RedisStorePubsubUri = ctx.String(SuaveConfidentialPubsubRedisEndpointFlag.Name)
}

if ctx.IsSet(SuaveConfidentialStoreRedisEndpointFlag.Name) {
cfg.RedisStoreUri = ctx.String(SuaveConfidentialStoreRedisEndpointFlag.Name)
}
}

// SetEthConfig applies eth-related command line flags to the config.
Expand Down
2 changes: 1 addition & 1 deletion core/types/sbundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ type SBundle struct {
Txs Transactions `json:"txs"`
RevertingHashes []common.Hash `json:"revertingHashes,omitempty"`
RefundPercent int `json:"percent,omitempty"`
MatchId [16]byte `json:"MatchId,omitempty"`
MatchId BidId `json:"MatchId,omitempty"`
}
4 changes: 3 additions & 1 deletion core/types/suave_structs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion core/vm/contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ type PrecompiledContract interface {
// During confidential execution the contract will be called with their RunConfidential method.
type SuavePrecompiledContract interface {
PrecompiledContract
RunConfidential(backend *SuaveExecutionBackend, input []byte) ([]byte, error)
RunConfidential(context *SuaveContext, input []byte) ([]byte, error)
}

// PrecompiledContractsHomestead contains the default set of pre-compiled Ethereum
Expand Down
Loading