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

netmap: EigenTrustAlpha config encoding diverges from the protocol #653

Open
cthulhu-rider opened this issue Dec 9, 2024 · 4 comments
Open
Labels
bug Something isn't working I4 No visible changes S4 Routine U2 Seriously planned
Milestone

Comments

@cthulhu-rider
Copy link
Contributor

Is your feature request related to a problem? Please describe.

Describe the solution you'd like

backport changes to API docs

Describe alternatives you've considered

harder way:

  • follow current protocol and fix encoding
  • fix config in the running networks

Additional context

Client testing

@cthulhu-rider cthulhu-rider added bug Something isn't working discussion Open discussion of some problem config Configuration format update or breaking change labels Dec 9, 2024
@roman-khimov
Copy link
Member

I think our networks are all configured with string-based values and I'd also check for reader code, probably it works with text-based ones as well. Overall I'd expect for API to win here.

@cthulhu-rider
Copy link
Contributor Author

cthulhu-rider commented Dec 9, 2024

func TestEigenTrustAlpha(t *testing.T) {
	m := &protonetmap.NetworkInfo{
		NetworkConfig: &protonetmap.NetworkConfig{
			Parameters: []*protonetmap.NetworkConfig_Parameter{
				{
					Key:   []byte("EigenTrustAlpha"),
					Value: []byte("0.123"),
				},
			},
		},
	}
	b, err := proto.Marshal(m)
	require.NoError(t, err)
	var n netmap.NetworkInfo
	require.NoError(t, n.Unmarshal(b))
	require.EqualValues(t, 0.123, n.EigenTrustAlpha())
}
=== RUN   TestEigenTrustAlpha
    network_info_test.go:524: 
        	Error Trace:	/home/ll/projects/neofs/sdk/netmap/network_info_test.go:524
        	Error:      	Not equal: 
        	            	expected: 0.123
        	            	actual  : 1.08637830059e-312
        	Test:       	TestIk
--- FAIL: TestIk (0.00s)

$ neo-go contract testinvokefunction -r https://rpc1.morph.fs.neo.org:40341 7c5bdb23e36cc7cce95bf42f3ab9e452c2501df1 config string:EigenTrustAlpha
{
  "state": "HALT",
  "gasconsumed": "2849820",
  "script": "DA9FaWdlblRydXN0QWxwaGERwB8MBmNvbmZpZwwU8R1QwlLkuTov9FvpzMds4yPbW3xBYn1bUg==",
  "stack": [
    {
      "type": "ByteString",
      "value": "MC4x"
    }
  ],
  "exception": null,
  "notifications": []
}

which is 0.1

@roman-khimov
Copy link
Member

@cthulhu-rider
Copy link
Contributor Author

$ neofs-cli netmap netinfo -r grpcs://st1.storage.fs.neo.org:8082
Epoch: 28043
Network magic: [net 0x572dfa5] 91414437
Time per block: 15s
NeoFS network configuration (system)
  Audit fee: 50000000
  Storage price: 100000
  Container fee: 1000000000
  Container alias fee: 200
  EigenTrust alpha: 0.1
  Number of EigenTrust iterations: 4
  Epoch duration: 240
  Inner Ring candidate fee: 10000000000
  Maximum object size: 67108864
  Withdrawal fee: 100000000
  Homomorphic hashing disabled: false
  Maintenance mode allowed: true
NeoFS network configuration (other)

interpretation is OK, incorrectly transmitted

@cthulhu-rider cthulhu-rider removed discussion Open discussion of some problem config Configuration format update or breaking change labels Dec 9, 2024
@roman-khimov roman-khimov added U2 Seriously planned S4 Routine I4 No visible changes labels Dec 9, 2024
@roman-khimov roman-khimov added this to the v1.0.0-rc13 milestone Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working I4 No visible changes S4 Routine U2 Seriously planned
Projects
None yet
Development

No branches or pull requests

2 participants