Optimize ClassGraph Scanning
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 35/100
Piste de recherche
Start with SerializerRegistryImpl.findAndSetContents() and RoutingRegistryImpl.findAndSetContracts(), then review their ClassGraph scan setup and the ScanResult.toJSON()/fromJSON() APIs. Determine how optional packaged metadata can be shared by both registries while preserving runtime scanning when absent. Done means startup discovers serializers, contracts, and data types without duplicate full-classpath scans when an index is present, with fallback and GraalVM Native Image limitations documented.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Current Status
The Java contract API performs two separate ClassGraph scans during startup:
SerializerRegistryImpl.findAndSetContents()scans the runtime classpath for classes annotated with@Serializer.RoutingRegistryImpl.findAndSetContracts()scans the runtime classpath for classes annotated with@Contractand@DataType.
Both scans use new ClassGraph().enableClassInfo().enableAnnotationInfo().scan(). For chaincodes with many dependencies, scanning the full classpath can increase startup time. This work is repeated whenever the chaincode starts, including when a peer restarts and launches its chaincode again.
ClassGraph provides ScanResult.toJSON() and ScanResult.fromJSON(String) APIs that may allow scan metadata to be generated during the build and reused at runtime.
Expected
Chaincode startup should be able to discover serializers, contracts, and data types from pre-generated scan metadata rather than scanning the full runtime classpath each time.
The change should preserve existing behavior for users who do not provide generated metadata. It should also document any limitations or additional requirements for using this approach with GraalVM Native Image, where dynamic class loading and reflection may require build-time configuration.
Solution
Add an optional build-time scan-index mechanism that packages ClassGraph metadata with the chaincode. At runtime, the shim should load that metadata and share the resulting scan information between SerializerRegistryImpl and RoutingRegistryImpl, avoiding duplicate full-classpath scans.
When no index is available, the shim should fall back to the current runtime scanning behavior. The implementation could use ClassGraph's ScanResult.toJSON() and ScanResult.fromJSON(String) APIs, or another generated-index approach, while ensuring discovered classes can still be loaded and instantiated. Any extra GraalVM Native Image configuration needed for those classes should be documented.
Please let us know if you plan to work on this.
Yes!
- Langage dominant
- Java
- Étoiles
- 322
- Forks
- 210
- Merge moyen
- 15 h 16 min
- PR mergées (30 j)
- 29
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de hyperledger/fabric-chaincode-java
-
enhancement
Difficulté 4/5 3-5 jours Accessibilité débutants 48/100
hyperledger/fabric-chaincode-java#628 ·
Les mainteneurs répondent en général sous 1 jour
-
DataType nested classOuvertebug
Difficulté 3/5 1-2 jours Accessibilité débutants 75/100
hyperledger/fabric-chaincode-java#626 ·
Les mainteneurs répondent en général sous 1 jour
-
External Chaincode Mutual TLSOuvertebug
Difficulté 3/5 1-2 jours Accessibilité débutants 68/100
hyperledger/fabric-chaincode-java#625 ·
Les mainteneurs répondent en général sous 1 jour
-
Read/write batchingPeut-être à nouveau libre @jadebluestar l’a pris il y a 119 jours, et aucune pull request n’est ouverte. Ouverteenhancement help wanted
Difficulté 4/5 3-5 jours Accessibilité débutants 45/100
hyperledger/fabric-chaincode-java#378 · 4 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
Publish docs on pushOuverte
Difficulté 3/5 1-2 jours Accessibilité débutants 52/100
hyperledger/fabric-chaincode-java#372 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de hyperledger/fabric-chaincode-java
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
2026 Error Report
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
triplea-game/triplea#15096 ·
Les mainteneurs répondent en général sous 1 jour
-
Implement JDBC Domain Enums (`SqlCategory`, `SqlExecutionStatus`, `SqlExecutionType`) in Core ModuleOuvertecore-module enhancement good first issue
Difficulté 1/5 1-3 heures Accessibilité débutants 87/100
sdlc-pro/spring-lens#531 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 67/100
Low-Drag-MC/LDLib2#78 ·
-
[GLOBAL] Advancement resetOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 67/100
Vakore/ZappierGames#184 ·