From 39632084b033bccc3aba716c9a37f7155477097d Mon Sep 17 00:00:00 2001 From: David Date: Mon, 11 Mar 2024 13:53:24 +0800 Subject: [PATCH] feat(prover): remove more database related code (#623) --- cmd/flags/prover.go | 15 --------------- prover/config.go | 4 ---- prover/config_test.go | 8 +------- prover/prover_test.go | 1 - 4 files changed, 1 insertion(+), 27 deletions(-) diff --git a/cmd/flags/prover.go b/cmd/flags/prover.go index 7c43aef3c..2df28ed24 100644 --- a/cmd/flags/prover.go +++ b/cmd/flags/prover.go @@ -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", @@ -216,8 +203,6 @@ var ProverFlags = MergeFlags(CommonFlags, []cli.Flag{ MaxProposedIn, TaikoTokenAddress, MaxAcceptableBlockSlippage, - DatabasePath, - DatabaseCacheSize, ProverAssignmentHookAddress, Allowance, L1NodeVersion, diff --git a/prover/config.go b/prover/config.go index 469c2200c..6e76d2603 100644 --- a/prover/config.go +++ b/prover/config.go @@ -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 @@ -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), diff --git a/prover/config_test.go b/prover/config_test.go index 425bd17e3..95c29f189 100644 --- a/prover/config_test.go +++ b/prover/config_test.go @@ -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") @@ -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()) @@ -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, @@ -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}, diff --git a/prover/prover_test.go b/prover/prover_test.go index e88953485..db76e6d73 100644 --- a/prover/prover_test.go +++ b/prover/prover_test.go @@ -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,