Skip to content

Commit

Permalink
Merge pull request #333 from LF-Decentralized-Trust-labs/dynamic-coor…
Browse files Browse the repository at this point in the history
…inator-selection

WIP for dynamic coordinator selector
  • Loading branch information
hosie authored Nov 21, 2024
2 parents dc3f1b8 + b77767e commit d18833d
Show file tree
Hide file tree
Showing 145 changed files with 8,671 additions and 4,124 deletions.
11 changes: 11 additions & 0 deletions buildSrc/src/main/groovy/Mockery.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ class Mockery extends DefaultTask {
@Optional
String outputPackage

@Input
boolean inpackage = false

@OutputDirectory
@Optional
File outputDir

void inputDir(Object dir) {
Expand All @@ -82,6 +86,10 @@ class Mockery extends DefaultTask {
outputDir = project.file(output)
}

void inpackage(boolean inPackage) {
inpackage = inPackage
}

protected void configure(ExecSpec spec) {
if (inputDir != null) {
spec.args '--dir', inputDir
Expand All @@ -98,6 +106,9 @@ class Mockery extends DefaultTask {
if (outputDir != null) {
spec.args '--output', outputDir
}
if (inpackage) {
spec.args '--inpackage'
}
}

}
Expand Down
2 changes: 2 additions & 0 deletions config/pkg/pldconf/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ type PaladinConfig struct {
TransportManagerConfig `json:",inline"`
RegistryManagerConfig `json:",inline"`
KeyManagerConfig `json:",inline"`
Startup StartupConfig `json:"startup"`
Log LogConfig `json:"log"`
Blockchain EthClientConfig `json:"blockchain"`
DB DBConfig `json:"db"`
RPCServer RPCServerConfig `json:"rpcServer"`
DebugServer DebugServerConfig `json:"debugServer"`
StateStore StateStoreConfig `json:"statestore"`
BlockIndexer BlockIndexerConfig `json:"blockIndexer"`
TempDir *string `json:"tempDir"`
Expand Down
4 changes: 4 additions & 0 deletions config/pkg/pldconf/domainmgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package pldconf

import (
"github.com/kaleido-io/paladin/config/pkg/confutil"
"github.com/kaleido-io/paladin/toolkit/pkg/tktypes"
)

// Intended to be embedded at root level of paladin config
Expand All @@ -35,8 +36,11 @@ type DomainConfig struct {
Config map[string]any `json:"config"`
RegistryAddress string `json:"registryAddress"`
AllowSigning bool `json:"allowSigning"`
DefaultGasLimit *uint64 `json:"defaultGasLimit"`
}

var DefaultDefaultGasLimit tktypes.HexUint64 = 4000000 // high gas limit by default (accommodating zkp transactions)

var ContractCacheDefaults = &CacheConfig{
Capacity: confutil.P(1000),
}
Expand Down
9 changes: 9 additions & 0 deletions config/pkg/pldconf/httpserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,12 @@ type StaticServerConfig struct {
StaticPath string `json:"staticPath"` // Path to the static files in the server FS e.g /app/ui
URLPath string `json:"urlPath"` // URL path to serve the static files e.g /ui -> http://host:port/ui
}

type DebugServerConfig struct {
Enabled *bool `json:"enabled"`
HTTPServerConfig
}

var DebugServerDefaults = &DebugServerConfig{
Enabled: confutil.P(false),
}
28 changes: 17 additions & 11 deletions config/pkg/pldconf/privatetxmgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,25 @@ var DistributerWriterConfigDefaults = FlushWriterConfig{

var PrivateTxManagerDefaults = &PrivateTxManagerConfig{
Sequencer: PrivateTxManagerSequencerConfig{
MaxConcurrentProcess: confutil.P(500),
EvaluationInterval: confutil.P("5m"),
PersistenceRetryTimeout: confutil.P("5s"),
StaleTimeout: confutil.P("10m"),
MaxPendingEvents: confutil.P(500),
MaxConcurrentProcess: confutil.P(500),
MaxInflightTransactions: confutil.P(500),
EvaluationInterval: confutil.P("5m"),
PersistenceRetryTimeout: confutil.P("5s"),
StaleTimeout: confutil.P("10m"),
MaxPendingEvents: confutil.P(500),
RoundRobinCoordinatorBlockRangeSize: confutil.P(100),
AssembleRequestTimeout: confutil.P("1s"),
},
RequestTimeout: confutil.P("15s"),
RequestTimeout: confutil.P("1s"),
}

type PrivateTxManagerSequencerConfig struct {
MaxConcurrentProcess *int `json:"maxConcurrentProcess,omitempty"`
MaxPendingEvents *int `json:"maxPendingEvents,omitempty"`
EvaluationInterval *string `json:"evalInterval,omitempty"`
PersistenceRetryTimeout *string `json:"persistenceRetryTimeout,omitempty"`
StaleTimeout *string `json:"staleTimeout,omitempty"`
MaxConcurrentProcess *int `json:"maxConcurrentProcess,omitempty"`
MaxInflightTransactions *int `json:"maxInflightTransactions,omitempty"`
MaxPendingEvents *int `json:"maxPendingEvents,omitempty"`
EvaluationInterval *string `json:"evalInterval,omitempty"`
PersistenceRetryTimeout *string `json:"persistenceRetryTimeout,omitempty"`
StaleTimeout *string `json:"staleTimeout,omitempty"`
RoundRobinCoordinatorBlockRangeSize *int `json:"roundRobinCoordinatorBlockRangeSize,omitempty"`
AssembleRequestTimeout *string `json:"assembleRequestTimeout,omitempty"`
}
36 changes: 36 additions & 0 deletions config/pkg/pldconf/startup.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Copyright © 2024 Kaleido, Inc.
//
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package pldconf

import (
"github.com/kaleido-io/paladin/config/pkg/confutil"
)

type StartupConfig struct {
BlockchainConnectRetry RetryConfigWithMax `json:"blockchainConnectRetry"`
}

var StartupConfigDefaults = StartupConfig{
BlockchainConnectRetry: RetryConfigWithMax{
RetryConfig: RetryConfig{
InitialDelay: confutil.P("500ms"),
MaxDelay: confutil.P("2s"),
Factor: confutil.P(2.0),
},
MaxAttempts: confutil.P(10),
},
}
14 changes: 7 additions & 7 deletions core/go/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ ext {
include "mocks/**/*.go"
}

targetCoverage = 93
targetCoverage = 92.5
maxCoverageBarGap = 1
coverageExcludedPackages = [
'github.com/kaleido-io/paladin/core/internal/privatetxnmgr/ptmgrtypes/mock_transaction_flow.go',
'github.com/kaleido-io/paladin/core/pkg/proto',
'github.com/kaleido-io/paladin/core/pkg/proto/transaction',
'github.com/kaleido-io/paladin/toolkit/prototk',
Expand Down Expand Up @@ -211,12 +212,6 @@ task makeMocks(type: Mockery, dependsOn: [":installMockery", protoc, goGet]) {
outputPackage 'componentmocks'
outputDir 'mocks/componentmocks'
}
mock {
inputDir 'internal/components'
name 'PublicTxBatch'
outputPackage 'componentmocks'
outputDir 'mocks/componentmocks'
}
mock {
inputDir "go list -f {{.Dir}} github.com/kaleido-io/paladin/toolkit/pkg/rpcserver".execute().text.trim()
includeAll true
Expand Down Expand Up @@ -247,6 +242,11 @@ task makeMocks(type: Mockery, dependsOn: [":installMockery", protoc, goGet]) {
outputPackage 'preparedtxdistributionmocks'
outputDir 'mocks/preparedtxdistributionmocks'
}
mock {
inputDir 'internal/privatetxnmgr/ptmgrtypes'
name "TransactionFlow"
inpackage true
}
}

task clean(type: Delete, dependsOn: ':testinfra:stopTestInfra') {
Expand Down
Loading

0 comments on commit d18833d

Please sign in to comment.