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

Invocatons of alphabet vote method #170

Merged
merged 6 commits into from
Dec 10, 2020

Conversation

alexvanin
Copy link
Contributor

Inner ring can invoke Vote method on corresponding alphabet contracts. This way it controls side chain. Now inner ring node invokes voting on startup if it is presented in config. This way alphabet contracts are able to produce more GAS for inner ring and storage nodes.

You can setup list of predefined validators in config.yml

morph:
  validators:
    - 02b3622bf4017bdfe317c58aed5f4c753f206b7db896046fa7d774bbc4bf7f8dc2
    - 0228b3b86d632a755da1e1f226bd782038acbe48e1f14e256b0afa58e32a45695e

or with environment variable (whitespace separated list)

NEOFS_IR_MORPH_VALIDATORS="02b3622bf4017bdfe317c58aed5f4c753f206b7db896046fa7d774bbc4bf7f8dc2 0228b3b86d632a755da1e1f226bd782038acbe48e1f14e256b0afa58e32a45695e"

If list is empty, then vote won't be invoked on startup.

In runtime node also can vote for validator from the comma-separated list.

./neofs-ir --config config.yml \
--vote 02b3622bf4017bdfe317c58aed5f4c753f206b7db896046fa7d774bbc4bf7f8dc2,0228b3b86d632a755da1e1f226bd782038acbe48e1f14e256b0afa58e32a45695e

@codecov
Copy link

codecov bot commented Nov 13, 2020

Codecov Report

Merging #170 (d8cd192) into master (6cddc91) will not change coverage.
The diff coverage is 0.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #170   +/-   ##
=======================================
  Coverage   46.91%   46.91%           
=======================================
  Files          60       60           
  Lines        2675     2675           
=======================================
  Hits         1255     1255           
  Misses       1290     1290           
  Partials      130      130           
Impacted Files Coverage Δ
pkg/morph/client/client.go 15.87% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6cddc91...d8cd192. Read the comment docs.

@alexvanin
Copy link
Contributor Author

Closed accidentally

@alexvanin
Copy link
Contributor Author

Update as nspcc-dev/neofs-contract#19 will be merged

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This function calculates validator key based on inner ring index
and invokes `Vote` method of corresponding alphabet contract.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
With this argument neofs-ir will be run as an CLI
application that initialize inner ring server, invokes
`vote` method on corresponding alphabet contract and
exits.

User can provide a comma-separated list of validator
public keys.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
Now alphabet contracts use signature collection to make
a vote. All inner ring nodes votes for some list of validators
the same way as they vote fore new epoch or new container.
As soon as list is accepted by alphabet contracts, each of them
votes for one candidate from the list.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
JSON-RPC method takes reversed hash as an input so it is
better to output reveresed hash in logs.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improving existing functionality neofs-ir Inner Ring node application issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants