Skip to content

[coordinator] Productization of the simple dependency manager#65

Merged
liran-funaro merged 2 commits into
hyperledger:mainfrom
liran-funaro:simple-dep-graph-prod
Aug 3, 2025
Merged

[coordinator] Productization of the simple dependency manager#65
liran-funaro merged 2 commits into
hyperledger:mainfrom
liran-funaro:simple-dep-graph-prod

Conversation

@liran-funaro

@liran-funaro liran-funaro commented Jul 6, 2025

Copy link
Copy Markdown
Contributor

Type of change

  • Improvement (improvement to code, performance, etc)

Description

Simple manager:

  • Add support for waiting TX limit
  • Add metrics
  • Add test
  • Optimize constructCompositeKey()

Performance

Benchmarking was done on an Apple M1 machine.
When dependency was introduced, it was with 30% dependent TXs.
The following tests are conducted with 2, 4, or 6 independent read-write keys, and dependent keys are added accordingly.
All combinations of dependencies were tested. However, all conflicts with write had the same performance as write-write conflicts.

image

Benchmark on i9-14900K
image

Related issues

@liran-funaro liran-funaro requested a review from cendhu July 6, 2025 14:21
@liran-funaro liran-funaro added the enhancement New feature or request label Jul 6, 2025
@cendhu cendhu requested a review from Copilot July 17, 2025 14:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR productionizes the simple dependency manager with significant improvements to performance, metrics, and testing. The changes focus on optimizing the simple dependency manager through various enhancements including TX limit support, comprehensive metrics integration, and performance optimizations.

  • Adds waiting TX limit support and comprehensive metrics to the simple dependency manager
  • Optimizes the constructCompositeKey() function for better performance with pre-allocation and efficient encoding
  • Replaces the Config struct with Parameters and removes the DummySigner in favor of nil checks for better performance

Reviewed Changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
utils/signature/sigtest/signer.go Removes DummySigner struct and optimizes signature handling with nil checks
service/coordinator/dependencygraph/simple.go Major refactoring with waiting TX limits, metrics integration, and performance improvements
service/coordinator/dependencygraph/transaction_node.go Optimizes constructCompositeKey function with better memory allocation and encoding
service/coordinator/dependencygraph/parameters.go New file defining Parameters struct to replace Config
service/coordinator/dependencygraph/manager_test.go Extensive test additions and benchmark improvements
service/coordinator/dependencygraph/manager.go Updates to use Parameters instead of Config
Multiple config files Updates default waiting TX limits and removes deprecated configuration options

Comment thread service/coordinator/dependencygraph/transaction_node.go
Comment thread service/coordinator/dependencygraph/transaction_node.go
Comment thread service/coordinator/dependencygraph/simple.go
@liran-funaro liran-funaro force-pushed the simple-dep-graph-prod branch from 860d5de to 3c31349 Compare July 17, 2025 16:12

@cendhu cendhu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. One small test needs to be added for waiting tx limit.

import "github.com/hyperledger/fabric-x-committer/utils/monitoring"

// Parameters holds the configuration for the dependency graph manager.
type Parameters struct {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why are we renaming it to Parameters from Config. I think, we have consistently used Config everywhere.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We use config for configurations (user-facing configurations with map-structure annotations). And parameters for function parameters. This struct is only used internally as parameters to the dependency graph, so it should be named as such.

Comment thread service/coordinator/dependencygraph/simple.go Outdated
Comment thread service/coordinator/dependencygraph/simple.go Outdated
Comment thread service/coordinator/dependencygraph/simple.go
Signed-off-by: Liran Funaro <liran.funaro@gmail.com>
Signed-off-by: Liran Funaro <liran.funaro@gmail.com>
@liran-funaro liran-funaro force-pushed the simple-dep-graph-prod branch from 3c31349 to 5635d02 Compare August 3, 2025 08:11
@liran-funaro liran-funaro merged commit cc092fc into hyperledger:main Aug 3, 2025
10 checks passed
@liran-funaro liran-funaro deleted the simple-dep-graph-prod branch August 3, 2025 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[dep-graph] Productization of the simple dependency graph

3 participants