Skip to content
This repository has been archived by the owner on May 11, 2024. It is now read-only.

Commit

Permalink
feat(prover): remove more database related code (#623)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha authored Mar 11, 2024
1 parent 2d00517 commit 3963208
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 27 deletions.
15 changes: 0 additions & 15 deletions cmd/flags/prover.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,19 +145,6 @@ var (
Value: 0,
Category: proverCategory,
}
// DB file location
// Required for guardian prover only
DatabasePath = &cli.StringFlag{
Name: "db.path",
Usage: "Database file location",
Category: proverCategory,
}
DatabaseCacheSize = &cli.Uint64Flag{
Name: "db.cacheSize",
Usage: "Database cache size in megabytes",
Value: 16,
Category: proverCategory,
}
Allowance = &cli.StringFlag{
Name: "prover.allowance",
Usage: "Amount to approve AssignmentHook contract for TaikoToken usage",
Expand Down Expand Up @@ -216,8 +203,6 @@ var ProverFlags = MergeFlags(CommonFlags, []cli.Flag{
MaxProposedIn,
TaikoTokenAddress,
MaxAcceptableBlockSlippage,
DatabasePath,
DatabaseCacheSize,
ProverAssignmentHookAddress,
Allowance,
L1NodeVersion,
Expand Down
4 changes: 0 additions & 4 deletions prover/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ type Config struct {
MaxExpiry time.Duration
MaxProposedIn uint64
MaxBlockSlippage uint64
DatabasePath string
DatabaseCacheSize uint64
Allowance *big.Int
GuardianProverHealthCheckServerEndpoint *url.URL
RaikoHostEndpoint string
Expand Down Expand Up @@ -175,8 +173,6 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) {
MaxExpiry: c.Duration(flags.MaxExpiry.Name),
MaxBlockSlippage: c.Uint64(flags.MaxAcceptableBlockSlippage.Name),
MaxProposedIn: c.Uint64(flags.MaxProposedIn.Name),
DatabasePath: c.String(flags.DatabasePath.Name),
DatabaseCacheSize: c.Uint64(flags.DatabaseCacheSize.Name),
Allowance: allowance,
L1NodeVersion: c.String(flags.L1NodeVersion.Name),
L2NodeVersion: c.String(flags.L2NodeVersion.Name),
Expand Down
8 changes: 1 addition & 7 deletions prover/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ var (
l1WsEndpoint = os.Getenv("L1_NODE_WS_ENDPOINT")
l1HttpEndpoint = os.Getenv("L1_NODE_HTTP_ENDPOINT")
l1BeaconEndpoint = os.Getenv("L1_NODE_HTTP_ENDPOINT")
l1NodeVersion = "1.0.0"
l2WsEndpoint = os.Getenv("L2_EXECUTION_ENGINE_WS_ENDPOINT")
l2HttpEndpoint = os.Getenv("L2_EXECUTION_ENGINE_HTTP_ENDPOINT")
l1NodeVersion = "1.0.0"
l2NodeVersion = "0.1.0"
taikoL1 = os.Getenv("TAIKO_L1_ADDRESS")
taikoL2 = os.Getenv("TAIKO_L2_ADDRESS")
Expand Down Expand Up @@ -57,8 +57,6 @@ func (s *ProverTestSuite) TestNewConfigFromCliContextGuardianProver() {
s.Equal(c.L2NodeVersion, l2NodeVersion)
s.Nil(new(Prover).InitFromCli(context.Background(), ctx))
s.True(c.ProveUnassignedBlocks)
s.Equal("dbPath", c.DatabasePath)
s.Equal(uint64(128), c.DatabaseCacheSize)
s.Equal(uint64(100), c.MaxProposedIn)
s.Equal(os.Getenv("ASSIGNMENT_HOOK_ADDRESS"), c.AssignmentHookAddress.String())
s.Equal(allowance, c.Allowance.String())
Expand Down Expand Up @@ -89,8 +87,6 @@ func (s *ProverTestSuite) TestNewConfigFromCliContextGuardianProver() {
"--" + flags.ProveBlockMaxTxGasFeeCap.Name, "256",
"--" + flags.Graffiti.Name, "",
"--" + flags.ProveUnassignedBlocks.Name,
"--" + flags.DatabasePath.Name, "dbPath",
"--" + flags.DatabaseCacheSize.Name, "128",
"--" + flags.MaxProposedIn.Name, "100",
"--" + flags.Allowance.Name, allowance,
"--" + flags.L1NodeVersion.Name, l1NodeVersion,
Expand Down Expand Up @@ -130,8 +126,6 @@ func (s *ProverTestSuite) SetupApp() *cli.App {
&cli.Uint64Flag{Name: flags.MinOptimisticTierFee.Name},
&cli.Uint64Flag{Name: flags.MinSgxTierFee.Name},
&cli.Uint64Flag{Name: flags.ProveBlockTxGasLimit.Name},
&cli.StringFlag{Name: flags.DatabasePath.Name},
&cli.Uint64Flag{Name: flags.DatabaseCacheSize.Name},
&cli.Uint64Flag{Name: flags.MaxProposedIn.Name},
&cli.StringFlag{Name: flags.ProverAssignmentHookAddress.Name},
&cli.StringFlag{Name: flags.Allowance.Name},
Expand Down
1 change: 0 additions & 1 deletion prover/prover_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,6 @@ func (s *ProverTestSuite) initProver(
MinSgxTierFee: common.Big1,
HTTPServerPort: uint64(port),
WaitReceiptTimeout: 12 * time.Second,
DatabasePath: "",
Allowance: new(big.Int).Exp(big.NewInt(1_000_000_100), new(big.Int).SetUint64(uint64(decimal)), nil),
RPCTimeout: 3 * time.Second,
BackOffRetryInterval: 3 * time.Second,
Expand Down

0 comments on commit 3963208

Please sign in to comment.