From 601d2ee04840d24fe13e5ec54ae09f2a623f3d02 Mon Sep 17 00:00:00 2001 From: Rasmus Dahlberg Date: Tue, 28 Dec 2021 21:32:38 +0100 Subject: db: Fix error prone timestamp configuration The timestamp for the latest tree head is now set based on the current UNIX time. This means that there is no longer any reliance on Trillian to move the timestamp forward every 5 minutes, just set -interval=300s. --- pkg/db/trillian.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pkg/db/trillian.go') diff --git a/pkg/db/trillian.go b/pkg/db/trillian.go index ab57db6..25b2fb3 100644 --- a/pkg/db/trillian.go +++ b/pkg/db/trillian.go @@ -3,6 +3,7 @@ package db import ( "context" "fmt" + "time" "git.sigsum.org/sigsum-lib-go/pkg/requests" "git.sigsum.org/sigsum-lib-go/pkg/types" @@ -173,7 +174,7 @@ func (c *TrillianClient) GetLeaves(ctx context.Context, req *requests.Leaves) (* func treeHeadFromLogRoot(lr *trillianTypes.LogRootV1) *types.TreeHead { th := types.TreeHead{ - Timestamp: uint64(lr.TimestampNanos / 1000 / 1000 / 1000), + Timestamp: uint64(time.Now().Unix()), TreeSize: uint64(lr.TreeSize), } copy(th.RootHash[:], lr.RootHash) -- cgit v1.2.3