Skip to content

Commit 4abdd83

Browse files
committedAug 5, 2024··
multipart: Set hashless header creation epoch
Signed-off-by: Evgenii Baidakov <evgenii@nspcc.io>
1 parent d126ec3 commit 4abdd83

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed
 

‎api/layer/multipart_upload.go

+1
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,7 @@ func (n *layer) uploadZeroPart(ctx context.Context, multipartInfo *data.Multipar
467467
hashlessHeaderObject.SetType(object.TypeRegular)
468468
hashlessHeaderObject.SetOwnerID(&bktInfo.Owner)
469469
hashlessHeaderObject.SetAttributes(attrs...)
470+
hashlessHeaderObject.SetCreationEpoch(n.neoFS.CurrentEpoch())
470471

471472
currentVersion := version.Current()
472473
hashlessHeaderObject.SetVersion(&currentVersion)

‎api/layer/neofs.go

+3
Original file line numberDiff line numberDiff line change
@@ -250,4 +250,7 @@ type NeoFS interface {
250250

251251
// IsHomomorphicHashingEnabled shows if homomorphic hashing is enabled in config.
252252
IsHomomorphicHashingEnabled() bool
253+
254+
// CurrentEpoch returns current epoch.
255+
CurrentEpoch() uint64
253256
}

‎internal/neofs/neofs.go

+5
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,11 @@ func (x *NeoFS) IsHomomorphicHashingEnabled() bool {
537537
return x.cfg.IsHomomorphicEnabled
538538
}
539539

540+
// CurrentEpoch returns current epoch.
541+
func (x *NeoFS) CurrentEpoch() uint64 {
542+
return x.epochGetter.CurrentEpoch()
543+
}
544+
540545
func isErrAccessDenied(err error) (string, bool) {
541546
unwrappedErr := errors.Unwrap(err)
542547
for unwrappedErr != nil {

0 commit comments

Comments
 (0)
Please sign in to comment.