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

core: init native interops in the genesis block #894

Merged
merged 13 commits into from
Apr 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion config/protocol.mainnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ ProtocolConfiguration:
- seed9.ngd.network:10333
- seed10.ngd.network:10333
SystemFee:
EnrollmentTransaction: 1000
IssueTransaction: 500
RegisterTransaction: 10000
VerifyBlocks: true
Expand Down
1 change: 0 additions & 1 deletion config/protocol.privnet.docker.four.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ ProtocolConfiguration:
- 172.200.0.3:20335
- 172.200.0.4:20336
SystemFee:
EnrollmentTransaction: 1000
IssueTransaction: 500
RegisterTransaction: 10000
VerifyBlocks: true
Expand Down
1 change: 0 additions & 1 deletion config/protocol.privnet.docker.one.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ ProtocolConfiguration:
- 172.200.0.3:20335
- 172.200.0.4:20336
SystemFee:
EnrollmentTransaction: 1000
IssueTransaction: 500
RegisterTransaction: 10000
VerifyBlocks: true
Expand Down
1 change: 0 additions & 1 deletion config/protocol.privnet.docker.single.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ ProtocolConfiguration:
SeedList:
- 172.200.0.1:20333
SystemFee:
EnrollmentTransaction: 1000
IssueTransaction: 500
RegisterTransaction: 10000
VerifyBlocks: true
Expand Down
1 change: 0 additions & 1 deletion config/protocol.privnet.docker.three.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ ProtocolConfiguration:
- 172.200.0.3:20335
- 172.200.0.4:20336
SystemFee:
EnrollmentTransaction: 1000
IssueTransaction: 500
RegisterTransaction: 10000
VerifyBlocks: true
Expand Down
1 change: 0 additions & 1 deletion config/protocol.privnet.docker.two.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ ProtocolConfiguration:
- 172.200.0.3:20335
- 172.200.0.4:20336
SystemFee:
EnrollmentTransaction: 1000
IssueTransaction: 500
RegisterTransaction: 10000
VerifyBlocks: true
Expand Down
1 change: 0 additions & 1 deletion config/protocol.testnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ ProtocolConfiguration:
- seed9.ngd.network:20333
- seed10.ngd.network:20333
SystemFee:
EnrollmentTransaction: 10
IssueTransaction: 5
RegisterTransaction: 100
VerifyBlocks: true
Expand Down
1 change: 0 additions & 1 deletion config/protocol.unit_testnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ ProtocolConfiguration:
- 127.0.0.1:20335
- 127.0.0.1:20336
SystemFee:
EnrollmentTransaction: 1000
IssueTransaction: 500
RegisterTransaction: 10000
VerifyBlocks: true
Expand Down
7 changes: 2 additions & 5 deletions pkg/config/protocol_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ type (

// SystemFee fees related to system.
SystemFee struct {
EnrollmentTransaction int64 `yaml:"EnrollmentTransaction"`
IssueTransaction int64 `yaml:"IssueTransaction"`
RegisterTransaction int64 `yaml:"RegisterTransaction"`
IssueTransaction int64 `yaml:"IssueTransaction"`
RegisterTransaction int64 `yaml:"RegisterTransaction"`
}

// NetMode describes the mode the blockchain will operate on.
Expand All @@ -75,8 +74,6 @@ func (n NetMode) String() string {
// TryGetValue returns the system fee base on transaction type.
func (s SystemFee) TryGetValue(txType transaction.TXType) util.Fixed8 {
switch txType {
case transaction.EnrollmentType:
return util.Fixed8FromInt64(s.EnrollmentTransaction)
case transaction.IssueType:
return util.Fixed8FromInt64(s.IssueTransaction)
case transaction.RegisterType:
Expand Down
14 changes: 2 additions & 12 deletions pkg/consensus/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -479,22 +479,12 @@ func (s *service) getVerifiedTx(count int) []block.Transaction {
return res
}

func (s *service) getValidators(txx ...block.Transaction) []crypto.PublicKey {
func (s *service) getValidators(_ ...block.Transaction) []crypto.PublicKey {
var (
pKeys []*keys.PublicKey
err error
)
if len(txx) == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When invoked with non-zero sized slice, it is used for calculating NextConsensus field.
DBFT needs to be changed, but for now we can return GetNextBlockValidators when invoked with non-zero slice.
https://github.com/neo-project/neo/blob/master/src/neo/Consensus/ConsensusContext.cs#L349

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think DBFT needs any change wrt this. We already do return next block validators from GetValidators.

pKeys, err = s.Chain.GetValidators()
} else {
ntxx := make([]*transaction.Transaction, len(txx))
for i := range ntxx {
ntxx[i] = txx[i].(*transaction.Transaction)
}

pKeys, err = s.Chain.GetValidators(ntxx...)
}

pKeys, err = s.Chain.GetValidators()
if err != nil {
s.log.Error("error while trying to get validators", zap.Error(err))
}
Expand Down
Loading