Optimize ClassGraph Scanning
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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!
- Lenguaje dominante
- Java
- Estrellas
- 322
- Forks
- 210
- Merge medio
- 15 h 16 min
- PR fusionados (30 d)
- 29
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de hyperledger/fabric-chaincode-java
-
enhancement
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
hyperledger/fabric-chaincode-java#628 ·
Los mantenedores suelen responder en 1 día
-
DataType nested classAbiertobug
Dificultad 3/5 1-2 días Aptitud para principiantes 75/100
hyperledger/fabric-chaincode-java#626 ·
Los mantenedores suelen responder en 1 día
-
External Chaincode Mutual TLSAbiertobug
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
hyperledger/fabric-chaincode-java#625 ·
Los mantenedores suelen responder en 1 día
-
Read/write batchingQuizá libre de nuevo @jadebluestar la tomó hace 118 días y no hay ningún pull request abierto. Abiertoenhancement help wanted
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
hyperledger/fabric-chaincode-java#378 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
Publish docs on pushAbierto
Dificultad 3/5 1-2 días Aptitud para principiantes 52/100
hyperledger/fabric-chaincode-java#372 ·
Los mantenedores suelen responder en 1 día
Todos los issues de hyperledger/fabric-chaincode-java
Issues similares
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
Ctrl + w should close dialogsAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 61/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
ReChronoRain/HyperCeiler#1743 ·
Los mantenedores suelen responder en 6 días
-
Create CONTRIBUTING.mdAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
ControlSystemStudio/phoebus#3979 ·
Los mantenedores suelen responder en 2 días
-
Cannot find symbol CTypedefPosiblemente ocupada @pellico la tomó hoy. Abiertobug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100