-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* make constants configuable * finish refactoring
- Loading branch information
Showing
36 changed files
with
1,043 additions
and
363 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--extensionacl on-declarations | ||
--maxwidth 150 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
public class BlockAuthor {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
Blockchain/Sources/Blockchain/Config/ProtocolConfig+Preset.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
import Utils | ||
|
||
extension Ref where T == ProtocolConfig { | ||
// TODO: pick some good numbers for dev env | ||
public static let dev = Ref(ProtocolConfig( | ||
auditTranchePeriod: 8, | ||
additionalMinBalancePerStateItem: 10, | ||
additionalMinBalancePerStateByte: 1, | ||
serviceMinBalance: 100, | ||
totalNumberOfCores: 341, | ||
preimagePurgePeriod: 28800, | ||
epochLength: 600, | ||
auditBiasFactor: 2, | ||
coreAccumulationGas: 10_000_000, // TODO: check this | ||
workPackageAuthorizerGas: 10_000_000, // TODO: check this | ||
workPackageRefineGas: 10_000_000, // TODO: check this | ||
recentHistorySize: 8, | ||
maxWorkItems: 4, | ||
maxTicketsPerExtrinsic: 16, | ||
maxLookupAnchorAge: 14400, | ||
transferMemoSize: 128, | ||
ticketEntriesPerValidator: 2, | ||
maxAuthorizationsPoolItems: 8, | ||
slotPeriodSeconds: 6, | ||
maxAuthorizationsQueueItems: 80, | ||
coreAssignmentRotationPeriod: 10, | ||
maxServiceCodeSize: 4_000_000, | ||
preimageReplacementPeriod: 5, | ||
totalNumberOfValidators: 1023, | ||
erasureCodedPieceSize: 684, | ||
maxWorkPackageManifestEntries: 1 << 11, | ||
maxEncodedWorkPackageSize: 12 * 1 << 20, | ||
maxEncodedWorkReportSize: 96 * 1 << 10, | ||
erasureCodedSegmentSize: 6, | ||
ticketSubmissionEndSlot: 500, | ||
pvmDynamicAddressAlignmentFactor: 4, | ||
pvmProgramInitInputDataSize: 1 << 24, | ||
pvmProgramInitPageSize: 1 << 14, | ||
pvmProgramInitSegmentSize: 1 << 16 | ||
)) | ||
|
||
public static let mainnet = Ref(ProtocolConfig( | ||
auditTranchePeriod: 8, | ||
additionalMinBalancePerStateItem: 10, | ||
additionalMinBalancePerStateByte: 1, | ||
serviceMinBalance: 100, | ||
totalNumberOfCores: 341, | ||
preimagePurgePeriod: 28800, | ||
epochLength: 600, | ||
auditBiasFactor: 2, | ||
coreAccumulationGas: 10_000_000, // TODO: check this | ||
workPackageAuthorizerGas: 10_000_000, // TODO: check this | ||
workPackageRefineGas: 10_000_000, // TODO: check this | ||
recentHistorySize: 8, | ||
maxWorkItems: 4, | ||
maxTicketsPerExtrinsic: 16, | ||
maxLookupAnchorAge: 14400, | ||
transferMemoSize: 128, | ||
ticketEntriesPerValidator: 2, | ||
maxAuthorizationsPoolItems: 8, | ||
slotPeriodSeconds: 6, | ||
maxAuthorizationsQueueItems: 80, | ||
coreAssignmentRotationPeriod: 10, | ||
maxServiceCodeSize: 4_000_000, | ||
preimageReplacementPeriod: 5, | ||
totalNumberOfValidators: 1023, | ||
erasureCodedPieceSize: 684, | ||
maxWorkPackageManifestEntries: 1 << 11, | ||
maxEncodedWorkPackageSize: 12 * 1 << 20, | ||
maxEncodedWorkReportSize: 96 * 1 << 10, | ||
erasureCodedSegmentSize: 6, | ||
ticketSubmissionEndSlot: 500, | ||
pvmDynamicAddressAlignmentFactor: 4, | ||
pvmProgramInitInputDataSize: 1 << 24, | ||
pvmProgramInitPageSize: 1 << 14, | ||
pvmProgramInitSegmentSize: 1 << 16 | ||
)) | ||
} |
Oops, something went wrong.