From 16a17e65895776fa4fa71fbda1548ca284fb8655 Mon Sep 17 00:00:00 2001 From: Lee Bousfield Date: Wed, 21 Aug 2024 14:13:24 -0500 Subject: [PATCH] Merge pull request #2600 from OffchainLabs/fix-s3-das-expiry Fix inverted expiry logic for DAS S3 backends --- das/s3_storage_service.go | 2 +- das/syncing_fallback_storage.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/das/s3_storage_service.go b/das/s3_storage_service.go index a1de200c52..a289b0d46f 100644 --- a/das/s3_storage_service.go +++ b/das/s3_storage_service.go @@ -110,7 +110,7 @@ func (s3s *S3StorageService) Put(ctx context.Context, value []byte, timeout uint Bucket: aws.String(s3s.bucket), Key: aws.String(s3s.objectPrefix + EncodeStorageServiceKey(dastree.Hash(value))), Body: bytes.NewReader(value)} - if !s3s.discardAfterTimeout { + if s3s.discardAfterTimeout { expires := time.Unix(int64(timeout), 0) putObjectInput.Expires = &expires } diff --git a/das/syncing_fallback_storage.go b/das/syncing_fallback_storage.go index ee0ddc6b5f..8af46b7fc5 100644 --- a/das/syncing_fallback_storage.go +++ b/das/syncing_fallback_storage.go @@ -105,9 +105,9 @@ type l1SyncService struct { lastBatchAcc common.Hash } -// The original syncing process had a bug, so the file was renamed to cause any mirrors -// in the wild to re-sync from their configured starting block number. -const nextBlockNoFilename = "nextBlockNumberV2" +// The filename has been updated when we have discovered bugs that may have impacted +// syncing, to cause mirrors to re-sync. +const nextBlockNoFilename = "nextBlockNumberV3" func readSyncStateOrDefault(syncDir string, dflt uint64) uint64 { if syncDir == "" {