From c49105936ec9d03f595d7de954173f2a424d5c4a Mon Sep 17 00:00:00 2001 From: "alex.sharov" Date: Sat, 20 Apr 2024 14:38:49 +0700 Subject: [PATCH 1/5] Reapply "save" This reverts commit 4fc678a2065d5f068f3d876d2dd8db5632c0579f. --- downloader/downloader.proto | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/downloader/downloader.proto b/downloader/downloader.proto index 26d3fbb..13eef18 100644 --- a/downloader/downloader.proto +++ b/downloader/downloader.proto @@ -11,6 +11,7 @@ service Downloader { // Erigon "download once" - means restart/upgrade/downgrade will not download files (and will be fast) // After "download once" - Erigon will produce and seed new files // Downloader will able: seed new files (already existing on FS), download uncomplete parts of existing files (if Verify found some bad parts) + // It returns current whitelist (whitelisted types). rpc ProhibitNewDownloads (ProhibitNewDownloadsRequest) returns (google.protobuf.Empty) {} // Adding new file to downloader: non-existing files it will download, existing - seed @@ -47,7 +48,7 @@ message StatsRequest { } message ProhibitNewDownloadsRequest { - string type = 1; + repeated string whitelistAdd = 1; // nil - means "don't modify". non-nil - means "merge with current whitelist". } message StatsReply { From b2bdc51f2965bad90f61f10f0bd86eca12bedd79 Mon Sep 17 00:00:00 2001 From: "alex.sharov" Date: Thu, 25 Apr 2024 10:28:52 +0700 Subject: [PATCH 2/5] save --- downloader/downloader.proto | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/downloader/downloader.proto b/downloader/downloader.proto index 13eef18..c61569e 100644 --- a/downloader/downloader.proto +++ b/downloader/downloader.proto @@ -11,8 +11,10 @@ service Downloader { // Erigon "download once" - means restart/upgrade/downgrade will not download files (and will be fast) // After "download once" - Erigon will produce and seed new files // Downloader will able: seed new files (already existing on FS), download uncomplete parts of existing files (if Verify found some bad parts) - // It returns current whitelist (whitelisted types). - rpc ProhibitNewDownloads (ProhibitNewDownloadsRequest) returns (google.protobuf.Empty) {} + // It will araise any existing whitelist + rpc ProhibitNewDownloads (google.protobuf.Empty) returns (google.protobuf.Empty) {} + // Whitelist some file types. If call before ProhibitNewDownloads - will return error. + rpc AllowNewDownloads (AllowNewDownloadsRequest) returns (google.protobuf.Empty) {} // Adding new file to downloader: non-existing files it will download, existing - seed rpc Add (AddRequest) returns (google.protobuf.Empty) {} @@ -48,7 +50,13 @@ message StatsRequest { } message ProhibitNewDownloadsRequest { - repeated string whitelistAdd = 1; // nil - means "don't modify". non-nil - means "merge with current whitelist". +} + +message AllowNewDownloadsRequest { + repeated string add = 1; // nil - means "don't modify". non-nil - means "merge with current whitelist". +} +message AllowNewDownloadsReply { + repeated string whitelist = 1; } message StatsReply { From 5355fd37741ea9ed58278c740dd8c8153a397a4e Mon Sep 17 00:00:00 2001 From: "alex.sharov" Date: Thu, 25 Apr 2024 10:34:37 +0700 Subject: [PATCH 3/5] save --- downloader/downloader.proto | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/downloader/downloader.proto b/downloader/downloader.proto index c61569e..6076eec 100644 --- a/downloader/downloader.proto +++ b/downloader/downloader.proto @@ -10,11 +10,11 @@ package downloader; service Downloader { // Erigon "download once" - means restart/upgrade/downgrade will not download files (and will be fast) // After "download once" - Erigon will produce and seed new files - // Downloader will able: seed new files (already existing on FS), download uncomplete parts of existing files (if Verify found some bad parts) - // It will araise any existing whitelist - rpc ProhibitNewDownloads (google.protobuf.Empty) returns (google.protobuf.Empty) {} - // Whitelist some file types. If call before ProhibitNewDownloads - will return error. - rpc AllowNewDownloads (AllowNewDownloadsRequest) returns (google.protobuf.Empty) {} + // After `ProhibitNewDownloads` call - downloader stil will able: + // - seed new files (already existing on FS) + // - download uncomplete parts of existing files (if Verify found some bad parts) + // `ProhibitNewDownloads` what whitelist based on file-type - can add remove items there. + rpc ProhibitNewDownloads (ProhibitNewDownloadsRequest) returns (ProhibitNewDownloadsReply) {} // Adding new file to downloader: non-existing files it will download, existing - seed rpc Add (AddRequest) returns (google.protobuf.Empty) {} @@ -50,13 +50,11 @@ message StatsRequest { } message ProhibitNewDownloadsRequest { + repeated string whitelistAdd = 1; // nil - means "don't modify". non-nil - means "merge with current whitelist". + repeated string whitelistRemove = 2; // nil - means "don't modify" } - -message AllowNewDownloadsRequest { - repeated string add = 1; // nil - means "don't modify". non-nil - means "merge with current whitelist". -} -message AllowNewDownloadsReply { - repeated string whitelist = 1; +message ProhibitNewDownloadsReply { + repeated string whitelist = 1; // current whitelist } message StatsReply { From dda221776f08f35b5b06f3dbc280d3dcd79bc49d Mon Sep 17 00:00:00 2001 From: "alex.sharov" Date: Thu, 25 Apr 2024 10:41:52 +0700 Subject: [PATCH 4/5] save --- downloader/downloader.proto | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/downloader/downloader.proto b/downloader/downloader.proto index 6076eec..08689c7 100644 --- a/downloader/downloader.proto +++ b/downloader/downloader.proto @@ -10,11 +10,11 @@ package downloader; service Downloader { // Erigon "download once" - means restart/upgrade/downgrade will not download files (and will be fast) // After "download once" - Erigon will produce and seed new files - // After `ProhibitNewDownloads` call - downloader stil will able: + // After `ProhibitNew` call - downloader stil will able: // - seed new files (already existing on FS) // - download uncomplete parts of existing files (if Verify found some bad parts) - // `ProhibitNewDownloads` what whitelist based on file-type - can add remove items there. - rpc ProhibitNewDownloads (ProhibitNewDownloadsRequest) returns (ProhibitNewDownloadsReply) {} + // `ProhibitNew` what whitelist based on file-type - can add remove items there. + rpc Prohibit (ProhibitRequest) returns (ProhibitReply) {} // Adding new file to downloader: non-existing files it will download, existing - seed rpc Add (AddRequest) returns (google.protobuf.Empty) {} @@ -49,11 +49,11 @@ message VerifyRequest { message StatsRequest { } -message ProhibitNewDownloadsRequest { +message ProhibitRequest { repeated string whitelistAdd = 1; // nil - means "don't modify". non-nil - means "merge with current whitelist". repeated string whitelistRemove = 2; // nil - means "don't modify" } -message ProhibitNewDownloadsReply { +message ProhibitReply { repeated string whitelist = 1; // current whitelist } From 6d3c46bff52503d8d3b6c88e7cc042369504c4ff Mon Sep 17 00:00:00 2001 From: "alex.sharov" Date: Thu, 25 Apr 2024 10:44:13 +0700 Subject: [PATCH 5/5] save --- downloader/downloader.proto | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/downloader/downloader.proto b/downloader/downloader.proto index 08689c7..c6de2a7 100644 --- a/downloader/downloader.proto +++ b/downloader/downloader.proto @@ -10,10 +10,11 @@ package downloader; service Downloader { // Erigon "download once" - means restart/upgrade/downgrade will not download files (and will be fast) // After "download once" - Erigon will produce and seed new files - // After `ProhibitNew` call - downloader stil will able: - // - seed new files (already existing on FS) - // - download uncomplete parts of existing files (if Verify found some bad parts) - // `ProhibitNew` what whitelist based on file-type - can add remove items there. + // After `Prohibit` call - downloader stil will able: + // - seed new (generated by Erigon) files + // - seed existing on Disk files + // - download uncomplete parts of existing on Disk files (if Verify found some bad parts) + // `Prohibit` has `whitelist` feature - based on file-type rpc Prohibit (ProhibitRequest) returns (ProhibitReply) {} // Adding new file to downloader: non-existing files it will download, existing - seed