Skip to content

Commit 9ab9579

Browse files
committed
switch to gcp dedup
1 parent dce89ea commit 9ab9579

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

cmd/gcp/main.go

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ import (
3434
"github.com/prometheus/client_golang/prometheus/promhttp"
3535
"github.com/rs/cors"
3636
sctfe "github.com/transparency-dev/static-ct"
37-
"github.com/transparency-dev/static-ct/modules/dedup"
38-
"github.com/transparency-dev/static-ct/storage/bbolt"
3937
gcpSCTFE "github.com/transparency-dev/static-ct/storage/gcp"
4038
tessera "github.com/transparency-dev/trillian-tessera"
4139
gcpTessera "github.com/transparency-dev/trillian-tessera/storage/gcp"
@@ -62,11 +60,11 @@ var (
6260
tracing = flag.Bool("tracing", false, "If true opencensus Stackdriver tracing will be enabled. See https://opencensus.io/.")
6361
tracingProjectID = flag.String("tracing_project_id", "", "project ID to pass to stackdriver. Can be empty for GCP, consult docs for other platforms.")
6462
tracingPercent = flag.Int("tracing_percent", 0, "Percent of requests to be traced. Zero is a special case to use the DefaultSampler.")
65-
dedupPath = flag.String("dedup_path", "", "Path to the deduplication database.")
6663
origin = flag.String("origin", "", "Origin of the log, for checkpoints and the monitoring prefix.")
6764
projectID = flag.String("project_id", "", "GCP ProjectID.")
6865
bucket = flag.String("bucket", "", "Name of the bucket to store the log in.")
6966
spannerDB = flag.String("spanner_db_path", "", "Spanner database path: projects/{projectId}/instances/{instanceId}/databases/{databaseId}.")
67+
spannerDedupDB = flag.String("spanner_dedup_db_path", "", "Spanner deduplication database path: projects/{projectId}/instances/{instanceId}/databases/{databaseId}.")
7068
rootsPemFile = flag.String("roots_pem_file", "", "Path to the file containing root certificates that are acceptable to the log. The certs are served through get-roots endpoint.")
7169
rejectExpired = flag.Bool("reject_expired", false, "If true then the certificate validity period will be checked against the current time during the validation of submissions. This will cause expired certificates to be rejected.")
7270
rejectUnexpired = flag.Bool("reject_unexpired", false, "If true then CTFE rejects certificates that are either currently valid or not yet valid.")
@@ -241,19 +239,11 @@ func newGCPStorage(ctx context.Context, signer note.Signer) (*sctfe.CTStorage, e
241239
return nil, fmt.Errorf("Failed to initialize GCP issuer storage: %v", err)
242240
}
243241

244-
// TODO: replace with a global dedup storage for GCP
245-
beDedupStorage, err := bbolt.NewStorage(*dedupPath)
242+
beDedupStorage, err := gcpSCTFE.NewDedupeStorage(ctx, *spannerDedupDB)
246243
if err != nil {
247-
return nil, fmt.Errorf("failed to initialize BBolt deduplication database: %v", err)
244+
return nil, fmt.Errorf("failed to initialize GCP Spanner deduplication database: %v", err)
248245
}
249246

250-
fetcher, err := gcpSCTFE.GetFetcher(ctx, *bucket)
251-
if err != nil {
252-
return nil, fmt.Errorf("failed to get a log fetcher: %v", err)
253-
}
254-
255-
go dedup.UpdateFromLog(ctx, beDedupStorage, time.Second, fetcher, sctfe.DedupFromBundle)
256-
257247
return sctfe.NewCTSTorage(tesseraStorage, issuerStorage, beDedupStorage)
258248
}
259249

0 commit comments

Comments
 (0)