forked from TrueCloudLab/neoneo-go
config: rename StandbyValidators to StandbyCommittee
This commit is contained in:
parent
b14b047c78
commit
e5d973d3a4
12 changed files with 29 additions and 18 deletions
|
@ -2,7 +2,7 @@ ProtocolConfiguration:
|
||||||
Magic: 5195086
|
Magic: 5195086
|
||||||
SecondsPerBlock: 15
|
SecondsPerBlock: 15
|
||||||
MemPoolSize: 50000
|
MemPoolSize: 50000
|
||||||
StandbyValidators:
|
StandbyCommittee:
|
||||||
- 03b209fd4f53a7170ea4444e0cb0a6bb6a53c2bd016926989cf85f9b0fba17a70c
|
- 03b209fd4f53a7170ea4444e0cb0a6bb6a53c2bd016926989cf85f9b0fba17a70c
|
||||||
- 02df48f60e8f3e01c48ff40b9b7f1310d7a8b2a193188befe1c2e3df740e895093
|
- 02df48f60e8f3e01c48ff40b9b7f1310d7a8b2a193188befe1c2e3df740e895093
|
||||||
- 03b8d9d5771d8f513aa0869b9cc8d50986403b78c6da36890638c3d46a5adce04a
|
- 03b8d9d5771d8f513aa0869b9cc8d50986403b78c6da36890638c3d46a5adce04a
|
||||||
|
@ -10,6 +10,7 @@ ProtocolConfiguration:
|
||||||
- 024c7b7fb6c310fccf1ba33b082519d82964ea93868d676662d4a59ad548df0e7d
|
- 024c7b7fb6c310fccf1ba33b082519d82964ea93868d676662d4a59ad548df0e7d
|
||||||
- 02aaec38470f6aad0042c6e877cfd8087d2676b0f516fddd362801b9bd3936399e
|
- 02aaec38470f6aad0042c6e877cfd8087d2676b0f516fddd362801b9bd3936399e
|
||||||
- 02486fd15702c4490a26703112a5cc1d0923fd697a33406bd5a1c00e0013b09a70
|
- 02486fd15702c4490a26703112a5cc1d0923fd697a33406bd5a1c00e0013b09a70
|
||||||
|
ValidatorsCount: 7
|
||||||
SeedList:
|
SeedList:
|
||||||
- seed1.neo.org:10333
|
- seed1.neo.org:10333
|
||||||
- seed2.neo.org:10333
|
- seed2.neo.org:10333
|
||||||
|
|
|
@ -2,11 +2,12 @@ ProtocolConfiguration:
|
||||||
Magic: 56753
|
Magic: 56753
|
||||||
SecondsPerBlock: 15
|
SecondsPerBlock: 15
|
||||||
MemPoolSize: 50000
|
MemPoolSize: 50000
|
||||||
StandbyValidators:
|
StandbyCommittee:
|
||||||
- 02b3622bf4017bdfe317c58aed5f4c753f206b7db896046fa7d774bbc4bf7f8dc2
|
- 02b3622bf4017bdfe317c58aed5f4c753f206b7db896046fa7d774bbc4bf7f8dc2
|
||||||
- 02103a7f7dd016558597f7960d27c516a4394fd968b9e65155eb4b013e4040406e
|
- 02103a7f7dd016558597f7960d27c516a4394fd968b9e65155eb4b013e4040406e
|
||||||
- 03d90c07df63e690ce77912e10ab51acc944b66860237b608c4f8f8309e71ee699
|
- 03d90c07df63e690ce77912e10ab51acc944b66860237b608c4f8f8309e71ee699
|
||||||
- 02a7bc55fe8684e0119768d104ba30795bdcc86619e864add26156723ed185cd62
|
- 02a7bc55fe8684e0119768d104ba30795bdcc86619e864add26156723ed185cd62
|
||||||
|
ValidatorsCount: 4
|
||||||
SeedList:
|
SeedList:
|
||||||
- 172.200.0.1:20333
|
- 172.200.0.1:20333
|
||||||
- 172.200.0.2:20334
|
- 172.200.0.2:20334
|
||||||
|
|
|
@ -2,11 +2,12 @@ ProtocolConfiguration:
|
||||||
Magic: 56753
|
Magic: 56753
|
||||||
SecondsPerBlock: 15
|
SecondsPerBlock: 15
|
||||||
MemPoolSize: 50000
|
MemPoolSize: 50000
|
||||||
StandbyValidators:
|
StandbyCommittee:
|
||||||
- 02b3622bf4017bdfe317c58aed5f4c753f206b7db896046fa7d774bbc4bf7f8dc2
|
- 02b3622bf4017bdfe317c58aed5f4c753f206b7db896046fa7d774bbc4bf7f8dc2
|
||||||
- 02103a7f7dd016558597f7960d27c516a4394fd968b9e65155eb4b013e4040406e
|
- 02103a7f7dd016558597f7960d27c516a4394fd968b9e65155eb4b013e4040406e
|
||||||
- 03d90c07df63e690ce77912e10ab51acc944b66860237b608c4f8f8309e71ee699
|
- 03d90c07df63e690ce77912e10ab51acc944b66860237b608c4f8f8309e71ee699
|
||||||
- 02a7bc55fe8684e0119768d104ba30795bdcc86619e864add26156723ed185cd62
|
- 02a7bc55fe8684e0119768d104ba30795bdcc86619e864add26156723ed185cd62
|
||||||
|
ValidatorsCount: 4
|
||||||
SeedList:
|
SeedList:
|
||||||
- 172.200.0.1:20333
|
- 172.200.0.1:20333
|
||||||
- 172.200.0.2:20334
|
- 172.200.0.2:20334
|
||||||
|
|
|
@ -2,8 +2,9 @@ ProtocolConfiguration:
|
||||||
Magic: 56753
|
Magic: 56753
|
||||||
SecondsPerBlock: 1
|
SecondsPerBlock: 1
|
||||||
MemPoolSize: 50000
|
MemPoolSize: 50000
|
||||||
StandbyValidators:
|
StandbyCommittee:
|
||||||
- 02b3622bf4017bdfe317c58aed5f4c753f206b7db896046fa7d774bbc4bf7f8dc2
|
- 02b3622bf4017bdfe317c58aed5f4c753f206b7db896046fa7d774bbc4bf7f8dc2
|
||||||
|
ValidatorsCount: 1
|
||||||
SeedList:
|
SeedList:
|
||||||
- 172.200.0.1:20333
|
- 172.200.0.1:20333
|
||||||
VerifyBlocks: true
|
VerifyBlocks: true
|
||||||
|
|
|
@ -2,11 +2,12 @@ ProtocolConfiguration:
|
||||||
Magic: 56753
|
Magic: 56753
|
||||||
SecondsPerBlock: 15
|
SecondsPerBlock: 15
|
||||||
MemPoolSize: 50000
|
MemPoolSize: 50000
|
||||||
StandbyValidators:
|
StandbyCommittee:
|
||||||
- 02b3622bf4017bdfe317c58aed5f4c753f206b7db896046fa7d774bbc4bf7f8dc2
|
- 02b3622bf4017bdfe317c58aed5f4c753f206b7db896046fa7d774bbc4bf7f8dc2
|
||||||
- 02103a7f7dd016558597f7960d27c516a4394fd968b9e65155eb4b013e4040406e
|
- 02103a7f7dd016558597f7960d27c516a4394fd968b9e65155eb4b013e4040406e
|
||||||
- 03d90c07df63e690ce77912e10ab51acc944b66860237b608c4f8f8309e71ee699
|
- 03d90c07df63e690ce77912e10ab51acc944b66860237b608c4f8f8309e71ee699
|
||||||
- 02a7bc55fe8684e0119768d104ba30795bdcc86619e864add26156723ed185cd62
|
- 02a7bc55fe8684e0119768d104ba30795bdcc86619e864add26156723ed185cd62
|
||||||
|
ValidatorsCount: 4
|
||||||
SeedList:
|
SeedList:
|
||||||
- 172.200.0.1:20333
|
- 172.200.0.1:20333
|
||||||
- 172.200.0.2:20334
|
- 172.200.0.2:20334
|
||||||
|
|
|
@ -2,11 +2,12 @@ ProtocolConfiguration:
|
||||||
Magic: 56753
|
Magic: 56753
|
||||||
SecondsPerBlock: 15
|
SecondsPerBlock: 15
|
||||||
MemPoolSize: 50000
|
MemPoolSize: 50000
|
||||||
StandbyValidators:
|
StandbyCommittee:
|
||||||
- 02b3622bf4017bdfe317c58aed5f4c753f206b7db896046fa7d774bbc4bf7f8dc2
|
- 02b3622bf4017bdfe317c58aed5f4c753f206b7db896046fa7d774bbc4bf7f8dc2
|
||||||
- 02103a7f7dd016558597f7960d27c516a4394fd968b9e65155eb4b013e4040406e
|
- 02103a7f7dd016558597f7960d27c516a4394fd968b9e65155eb4b013e4040406e
|
||||||
- 03d90c07df63e690ce77912e10ab51acc944b66860237b608c4f8f8309e71ee699
|
- 03d90c07df63e690ce77912e10ab51acc944b66860237b608c4f8f8309e71ee699
|
||||||
- 02a7bc55fe8684e0119768d104ba30795bdcc86619e864add26156723ed185cd62
|
- 02a7bc55fe8684e0119768d104ba30795bdcc86619e864add26156723ed185cd62
|
||||||
|
ValidatorsCount: 4
|
||||||
SeedList:
|
SeedList:
|
||||||
- 172.200.0.1:20333
|
- 172.200.0.1:20333
|
||||||
- 172.200.0.2:20334
|
- 172.200.0.2:20334
|
||||||
|
|
|
@ -2,7 +2,7 @@ ProtocolConfiguration:
|
||||||
Magic: 56753
|
Magic: 56753
|
||||||
SecondsPerBlock: 15
|
SecondsPerBlock: 15
|
||||||
MemPoolSize: 50000
|
MemPoolSize: 50000
|
||||||
StandbyValidators:
|
StandbyCommittee:
|
||||||
- 02b3622bf4017bdfe317c58aed5f4c753f206b7db896046fa7d774bbc4bf7f8dc2
|
- 02b3622bf4017bdfe317c58aed5f4c753f206b7db896046fa7d774bbc4bf7f8dc2
|
||||||
- 02103a7f7dd016558597f7960d27c516a4394fd968b9e65155eb4b013e4040406e
|
- 02103a7f7dd016558597f7960d27c516a4394fd968b9e65155eb4b013e4040406e
|
||||||
- 03d90c07df63e690ce77912e10ab51acc944b66860237b608c4f8f8309e71ee699
|
- 03d90c07df63e690ce77912e10ab51acc944b66860237b608c4f8f8309e71ee699
|
||||||
|
|
|
@ -2,7 +2,7 @@ ProtocolConfiguration:
|
||||||
Magic: 1951352142
|
Magic: 1951352142
|
||||||
SecondsPerBlock: 15
|
SecondsPerBlock: 15
|
||||||
MemPoolSize: 50000
|
MemPoolSize: 50000
|
||||||
StandbyValidators:
|
StandbyCommittee:
|
||||||
- 023e9b32ea89b94d066e649b124fd50e396ee91369e8e2a6ae1b11c170d022256d
|
- 023e9b32ea89b94d066e649b124fd50e396ee91369e8e2a6ae1b11c170d022256d
|
||||||
- 03009b7540e10f2562e5fd8fac9eaec25166a58b26e412348ff5a86927bfac22a2
|
- 03009b7540e10f2562e5fd8fac9eaec25166a58b26e412348ff5a86927bfac22a2
|
||||||
- 02ba2c70f5996f357a43198705859fae2cfea13e1172962800772b3d588a9d4abd
|
- 02ba2c70f5996f357a43198705859fae2cfea13e1172962800772b3d588a9d4abd
|
||||||
|
@ -10,6 +10,7 @@ ProtocolConfiguration:
|
||||||
- 02a7834be9b32e2981d157cb5bbd3acb42cfd11ea5c3b10224d7a44e98c5910f1b
|
- 02a7834be9b32e2981d157cb5bbd3acb42cfd11ea5c3b10224d7a44e98c5910f1b
|
||||||
- 0214baf0ceea3a66f17e7e1e839ea25fd8bed6cd82e6bb6e68250189065f44ff01
|
- 0214baf0ceea3a66f17e7e1e839ea25fd8bed6cd82e6bb6e68250189065f44ff01
|
||||||
- 030205e9cefaea5a1dfc580af20c8d5aa2468bb0148f1a5e4605fc622c80e604ba
|
- 030205e9cefaea5a1dfc580af20c8d5aa2468bb0148f1a5e4605fc622c80e604ba
|
||||||
|
ValidatorsCount: 7
|
||||||
SeedList:
|
SeedList:
|
||||||
- seed1t.neo.org:20333
|
- seed1t.neo.org:20333
|
||||||
- seed2t.neo.org:20333
|
- seed2t.neo.org:20333
|
||||||
|
|
|
@ -2,7 +2,7 @@ ProtocolConfiguration:
|
||||||
Magic: 42
|
Magic: 42
|
||||||
SecondsPerBlock: 15
|
SecondsPerBlock: 15
|
||||||
MemPoolSize: 50000
|
MemPoolSize: 50000
|
||||||
StandbyValidators:
|
StandbyCommittee:
|
||||||
- 02b3622bf4017bdfe317c58aed5f4c753f206b7db896046fa7d774bbc4bf7f8dc2
|
- 02b3622bf4017bdfe317c58aed5f4c753f206b7db896046fa7d774bbc4bf7f8dc2
|
||||||
- 02103a7f7dd016558597f7960d27c516a4394fd968b9e65155eb4b013e4040406e
|
- 02103a7f7dd016558597f7960d27c516a4394fd968b9e65155eb4b013e4040406e
|
||||||
- 03d90c07df63e690ce77912e10ab51acc944b66860237b608c4f8f8309e71ee699
|
- 03d90c07df63e690ce77912e10ab51acc944b66860237b608c4f8f8309e71ee699
|
||||||
|
|
|
@ -10,11 +10,11 @@ type (
|
||||||
Magic netmode.Magic `yaml:"Magic"`
|
Magic netmode.Magic `yaml:"Magic"`
|
||||||
MemPoolSize int `yaml:"MemPoolSize"`
|
MemPoolSize int `yaml:"MemPoolSize"`
|
||||||
// SaveStorageBatch enables storage batch saving before every persist.
|
// SaveStorageBatch enables storage batch saving before every persist.
|
||||||
SaveStorageBatch bool `yaml:"SaveStorageBatch"`
|
SaveStorageBatch bool `yaml:"SaveStorageBatch"`
|
||||||
SecondsPerBlock int `yaml:"SecondsPerBlock"`
|
SecondsPerBlock int `yaml:"SecondsPerBlock"`
|
||||||
SeedList []string `yaml:"SeedList"`
|
SeedList []string `yaml:"SeedList"`
|
||||||
StandbyValidators []string `yaml:"StandbyValidators"`
|
StandbyCommittee []string `yaml:"StandbyCommittee"`
|
||||||
ValidatorsCount int `yaml:"ValidatorsCount"`
|
ValidatorsCount int `yaml:"ValidatorsCount"`
|
||||||
// Whether to verify received blocks.
|
// Whether to verify received blocks.
|
||||||
VerifyBlocks bool `yaml:"VerifyBlocks"`
|
VerifyBlocks bool `yaml:"VerifyBlocks"`
|
||||||
// Whether to verify transactions in received blocks.
|
// Whether to verify transactions in received blocks.
|
||||||
|
|
|
@ -394,7 +394,7 @@ func addSigners(txs ...*transaction.Transaction) {
|
||||||
|
|
||||||
func signTx(bc *Blockchain, txs ...*transaction.Transaction) error {
|
func signTx(bc *Blockchain, txs ...*transaction.Transaction) error {
|
||||||
validators := bc.GetStandByValidators()
|
validators := bc.GetStandByValidators()
|
||||||
rawScript, err := smartcontract.CreateMultiSigRedeemScript(len(bc.config.StandbyValidators)/2+1, validators)
|
rawScript, err := smartcontract.CreateMultiSigRedeemScript(bc.config.ValidatorsCount/2+1, validators)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "fail to sign tx")
|
return errors.Wrap(err, "fail to sign tx")
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package core
|
package core
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/nspcc-dev/neo-go/pkg/config"
|
"github.com/nspcc-dev/neo-go/pkg/config"
|
||||||
|
@ -94,9 +95,12 @@ func deployNativeContracts(magic netmode.Magic) *transaction.Transaction {
|
||||||
}
|
}
|
||||||
|
|
||||||
func validatorsFromConfig(cfg config.ProtocolConfiguration) ([]*keys.PublicKey, error) {
|
func validatorsFromConfig(cfg config.ProtocolConfiguration) ([]*keys.PublicKey, error) {
|
||||||
validators := make([]*keys.PublicKey, len(cfg.StandbyValidators))
|
if len(cfg.StandbyCommittee) < cfg.ValidatorsCount {
|
||||||
for i, pubKeyStr := range cfg.StandbyValidators {
|
return nil, errors.New("validators count can be less than the size of StandbyCommittee")
|
||||||
pubKey, err := keys.NewPublicKeyFromString(pubKeyStr)
|
}
|
||||||
|
validators := make([]*keys.PublicKey, cfg.ValidatorsCount)
|
||||||
|
for i := range validators {
|
||||||
|
pubKey, err := keys.NewPublicKeyFromString(cfg.StandbyCommittee[i])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue