[#352] Add explicit max number of alphabet nodes #354
No reviewers
Labels
No labels
P0
P1
P2
P3
badger
frostfs-adm
frostfs-cli
frostfs-ir
frostfs-lens
frostfs-node
good first issue
triage
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
5 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#354
Loading…
Reference in a new issue
No description provided.
Delete branch "ale64bit/frostfs-node:fix/352-clarify-too-many-alpha-nodes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Signed-off-by: Alejandro Lopez a.lopez@yadro.com
@ -26,0 +26,4 @@
const (
// maxAlphabetNodes is the maximum number of candidates allowed, which is currently limited by the size
// of the verification script.
// See: https://github.com/nspcc-dev/neo-go/blob/740488f7f35e367eaa99a71c0a609c315fe2b0fc/pkg/core/transaction/witness.go#L10
I believe, it is invocation script, not verification.
done
@ -52,6 +61,10 @@ func initializeSideChainCmd(cmd *cobra.Command, _ []string) error {
}
defer initCtx.close()
if len(initCtx.Accounts) > maxAlphabetNodes {
What about failing inside
newInitializeContext
? This way we won't enter 23 passwords just to receive an error.done
@ -18,8 +18,8 @@ import (
"github.com/nspcc-dev/neo-go/pkg/vm/opcode"
)
// initialAlphabetNEOAmount represents the total amount of GAS distributed between alphabet nodes.
unrelated to the commit.
it's not unrelated. A new constant was added and this one was moved into a const block, so the comment needs to be nested as well since it refers to the specific constant and not to the whole block.
I mean the change is valid, but new constant was added not in this PR, can we just move this change (comment move) to another commit?
All such minor things in combination make diffs bigger and harder to read.
done
@ -46,3 +50,3 @@
}
func testInitialize(t *testing.T, committeeSize int) {
func testInitialize(t *testing.T, committeeSize int, wantErr error) {
Can we just explicitly call
generateTestData
in the test instead of adding a parameter here?we can. But what's the benefit?
testInitialize
tests initialization and checks all errors. It is not obvious, what error is expected here (for generation, initialization or sth else) and we use it only once.done
@ -82,2 +91,3 @@
func generateTestData(t *testing.T, dir string, size int) {
func generateTestData(t *testing.T, dir string, size int) error {
t.Helper()
Why do we need this line?
Since this file is
initialize_test.go
and it tests initialization, I don't think this function should be calling test assertions since it's just a helper. This function marks it as such, so that it's skipped in the log to avoid verbose output.We already have separate
generate_test.go
for testing generation specifically.Actually, I apologize. I had this call in an earlier version but in current form ofc it's not necessary. I removed it.
7a9743272c
to20661a0bc7
20661a0bc7
to52fd548060
52fd548060
to99b4464674