Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug encryption version #1513

Draft
wants to merge 1 commit into
base: staging
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ import (
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/datastore"
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/filestore"
"github.com/0chain/common/core/util/wmpt"
"go.uber.org/zap"
"gorm.io/gorm"

"github.com/0chain/blobber/code/go/0chain.net/blobbercore/reference"
"github.com/0chain/blobber/code/go/0chain.net/blobbercore/util"

"github.com/0chain/blobber/code/go/0chain.net/core/common"
"github.com/0chain/blobber/code/go/0chain.net/core/encryption"
"github.com/0chain/blobber/code/go/0chain.net/core/logging"
)

// swagger:model UploadFileChanger
Expand Down Expand Up @@ -209,6 +211,7 @@ func (nf *UploadFileChanger) ApplyChangeV2(ctx context.Context, allocationRoot,
if err != nil {
return 0, err
}
logging.Logger.Info("newFile", zap.Int("encVersion", nf.EncryptionVersion), zap.String("allocationID", nf.AllocationID), zap.String("path", nf.Path))
collector.CreateRefRecord(newFile)
numFiles.Add(1)
decodedKey, _ := hex.DecodeString(newFile.LookupHash)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ func (cmd *UploadFileCommand) IsValidated(ctx context.Context, req *http.Request
}
cmd.contentFile = origfile
cmd.fileChanger = fileChanger
logging.Logger.Info("UploadFileCommand.IsValidated", zap.Int("encryption_version", fileChanger.EncryptionVersion), zap.String("allocationID", fileChanger.AllocationID), zap.String("path", fileChanger.Path))
return nil
}

Expand Down
4 changes: 3 additions & 1 deletion code/go/0chain.net/blobbercore/handler/storage_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@ func (fsh *StorageHandler) GetFileMeta(ctx context.Context, r *http.Request) (in
}

result := fileref.GetListingData(ctx)

if fileref.Type == reference.FILE {
logging.Logger.Info("get_file_meta", zap.Int("encryption_version", fileref.EncryptionVersion), zap.Any("result_version", result["encryption_version"]), zap.String("allocation_id", allocationID), zap.String("path", fileref.Path))
}
if !isOwner && !isRepairer {
var authTokenString = r.FormValue("auth_token")

Expand Down
Loading