-
Notifications
You must be signed in to change notification settings - Fork 19
Primev poc #629
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
Open
blockchainluffy
wants to merge
29
commits into
main
Choose a base branch
from
primev-poc
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Primev poc #629
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
cf0fbf1
feat: add primev keyper definition and commitment gossip message
blockchainluffy 0941870
feat: add basic database queries and schema
blockchainluffy 42865d9
feat: add provider registry event syncer
blockchainluffy 535106e
fix: sql definition issue
blockchainluffy ccae033
update commitment message to include identities
blockchainluffy f16acd2
update config to include primev chain config and update providerSynce…
blockchainluffy e099c72
fix: CI to build docker image
blockchainluffy 5909157
fix CI for build
blockchainluffy 868cb00
fix primev keyper database mismatch
blockchainluffy 4b56c49
fix: getting block header for primev chain
blockchainluffy fc0e18c
primev: identity calculation to use bidder node address
blockchainluffy dfc6fbd
add logs for commitment message
blockchainluffy 7130772
update message middleware
blockchainluffy bdfb398
update bidder node address verification
blockchainluffy 08baf1d
update commitment handler to check msg type
blockchainluffy b00a818
update commitment message handling to include correct identity genera…
blockchainluffy 9178d2f
update commitment table to include bid related fields
blockchainluffy 4212a0f
primev: use random generated identity prefix
blockchainluffy 6436aad
primev: use provider registry contract binding as dependancy from mev…
blockchainluffy 47f2300
primev: update schema primary and foreign keys and queries
blockchainluffy 5d6d4ae
primev: include commitment message in the existing message file
blockchainluffy b8e1b10
primev: update config to not include http enabled flags
blockchainluffy a7c0d0c
primev: update commitment handler to generate dec trigger at the end
blockchainluffy 1947f4e
Merge branch 'main' into primev-poc
blockchainluffy f0a5508
primev: resolve build after merging main
blockchainluffy 52f62fc
fix: rs-generate ci
blockchainluffy a32b372
update example config values
blockchainluffy 6ef165e
fix: add identity prefix in committed tx table and update queries
blockchainluffy c8696aa
fix: commitment handler to non-blocking
blockchainluffy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| package primevkeyper | ||
|
|
||
| import ( | ||
| "context" | ||
|
|
||
| "github.com/jackc/pgx/v4/pgxpool" | ||
| "github.com/pkg/errors" | ||
| "github.com/rs/zerolog/log" | ||
| "github.com/spf13/cobra" | ||
|
|
||
| "github.com/shutter-network/rolling-shutter/rolling-shutter/cmd/shversion" | ||
| keyper "github.com/shutter-network/rolling-shutter/rolling-shutter/keyperimpl/primev" | ||
| "github.com/shutter-network/rolling-shutter/rolling-shutter/keyperimpl/primev/database" | ||
| "github.com/shutter-network/rolling-shutter/rolling-shutter/medley/configuration/command" | ||
| "github.com/shutter-network/rolling-shutter/rolling-shutter/medley/db" | ||
| "github.com/shutter-network/rolling-shutter/rolling-shutter/medley/service" | ||
| ) | ||
|
|
||
| func Cmd() *cobra.Command { | ||
| builder := command.Build( | ||
| main, | ||
| command.Usage( | ||
| "Run a Shutter keyper for PrimeV POC", | ||
| `This command runs a keyper node. It will connect to both a PrimeV and a | ||
| Shuttermint node which have to be started separately in advance.`, | ||
| ), | ||
| command.WithGenerateConfigSubcommand(), | ||
| command.WithDumpConfigSubcommand(), | ||
| ) | ||
| builder.AddInitDBCommand(initDB) | ||
| return builder.Command() | ||
| } | ||
|
|
||
| func main(config *keyper.Config) error { | ||
| log.Info(). | ||
| Str("version", shversion.Version()). | ||
| Str("address", config.GetAddress().Hex()). | ||
| Str("shuttermint", config.Shuttermint.ShuttermintURL). | ||
| Msg("starting primev keyper") | ||
|
|
||
| kpr := keyper.New(config) | ||
| return service.RunWithSighandler(context.Background(), kpr) | ||
| } | ||
|
|
||
| func initDB(cfg *keyper.Config) error { | ||
| ctx := context.Background() | ||
| dbpool, err := pgxpool.Connect(ctx, cfg.DatabaseURL) | ||
| if err != nil { | ||
| return errors.Wrap(err, "failed to connect to database") | ||
| } | ||
| defer dbpool.Close() | ||
| return db.InitDB(ctx, dbpool, database.Definition.Name(), database.Definition) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| ## rolling-shutter primevkeyper | ||
|
|
||
| Run a Shutter keyper for PrimeV POC | ||
|
|
||
| ### Synopsis | ||
|
|
||
| This command runs a keyper node. It will connect to both a PrimeV and a | ||
| Shuttermint node which have to be started separately in advance. | ||
|
|
||
| ``` | ||
| rolling-shutter primevkeyper [flags] | ||
| ``` | ||
|
|
||
| ### Options | ||
|
|
||
| ``` | ||
| --config string config file | ||
| -h, --help help for primevkeyper | ||
| ``` | ||
|
|
||
| ### Options inherited from parent commands | ||
|
|
||
| ``` | ||
| --logformat string set log format, possible values: min, short, long, max (default "long") | ||
| --loglevel string set log level, possible values: warn, info, debug (default "info") | ||
| --no-color do not write colored logs | ||
| ``` | ||
|
|
||
| ### SEE ALSO | ||
|
|
||
| * [rolling-shutter](rolling-shutter.md) - A collection of commands to run and interact with Rolling Shutter nodes | ||
| * [rolling-shutter primevkeyper dump-config](rolling-shutter_primevkeyper_dump-config.md) - Dump a 'primevkeyper' configuration file, based on given config and env vars | ||
| * [rolling-shutter primevkeyper generate-config](rolling-shutter_primevkeyper_generate-config.md) - Generate a 'primevkeyper' configuration file | ||
| * [rolling-shutter primevkeyper initdb](rolling-shutter_primevkeyper_initdb.md) - Initialize the database of the 'primevkeyper' | ||
|
|
29 changes: 29 additions & 0 deletions
29
rolling-shutter/docs/rolling-shutter_primevkeyper_dump-config.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| ## rolling-shutter primevkeyper dump-config | ||
|
|
||
| Dump a 'primevkeyper' configuration file, based on given config and env vars | ||
|
|
||
| ``` | ||
| rolling-shutter primevkeyper dump-config [flags] | ||
| ``` | ||
|
|
||
| ### Options | ||
|
|
||
| ``` | ||
| --config string config file | ||
| -f, --force overwrite existing file | ||
| -h, --help help for dump-config | ||
| --output string output file | ||
| ``` | ||
|
|
||
| ### Options inherited from parent commands | ||
|
|
||
| ``` | ||
| --logformat string set log format, possible values: min, short, long, max (default "long") | ||
| --loglevel string set log level, possible values: warn, info, debug (default "info") | ||
| --no-color do not write colored logs | ||
| ``` | ||
|
|
||
| ### SEE ALSO | ||
|
|
||
| * [rolling-shutter primevkeyper](rolling-shutter_primevkeyper.md) - Run a Shutter keyper for PrimeV POC | ||
|
|
29 changes: 29 additions & 0 deletions
29
rolling-shutter/docs/rolling-shutter_primevkeyper_generate-config.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| ## rolling-shutter primevkeyper generate-config | ||
|
|
||
| Generate a 'primevkeyper' configuration file | ||
|
|
||
| ``` | ||
| rolling-shutter primevkeyper generate-config [flags] | ||
| ``` | ||
|
|
||
| ### Options | ||
|
|
||
| ``` | ||
| -f, --force overwrite existing file | ||
| -h, --help help for generate-config | ||
| --output string output file | ||
| ``` | ||
|
|
||
| ### Options inherited from parent commands | ||
|
|
||
| ``` | ||
| --config string config file | ||
| --logformat string set log format, possible values: min, short, long, max (default "long") | ||
| --loglevel string set log level, possible values: warn, info, debug (default "info") | ||
| --no-color do not write colored logs | ||
| ``` | ||
|
|
||
| ### SEE ALSO | ||
|
|
||
| * [rolling-shutter primevkeyper](rolling-shutter_primevkeyper.md) - Run a Shutter keyper for PrimeV POC | ||
|
|
27 changes: 27 additions & 0 deletions
27
rolling-shutter/docs/rolling-shutter_primevkeyper_initdb.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| ## rolling-shutter primevkeyper initdb | ||
|
|
||
| Initialize the database of the 'primevkeyper' | ||
|
|
||
| ``` | ||
| rolling-shutter primevkeyper initdb [flags] | ||
| ``` | ||
|
|
||
| ### Options | ||
|
|
||
| ``` | ||
| -h, --help help for initdb | ||
| ``` | ||
|
|
||
| ### Options inherited from parent commands | ||
|
|
||
| ``` | ||
| --config string config file | ||
| --logformat string set log format, possible values: min, short, long, max (default "long") | ||
| --loglevel string set log level, possible values: warn, info, debug (default "info") | ||
| --no-color do not write colored logs | ||
| ``` | ||
|
|
||
| ### SEE ALSO | ||
|
|
||
| * [rolling-shutter primevkeyper](rolling-shutter_primevkeyper.md) - Run a Shutter keyper for PrimeV POC | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(General) I think we should add a dedicated spec document for this new keyper implementation under the existing docs/spec.md that describes the high-level design, key components, and how it differs from other implementations. Ideally we should have that for all implementations, but we can start here as part of this PR.