Fabric CA still relies on Fabric v1.4 source code
benjsmi opened this issue · 3 comments
Can we please remove this dependency from the Fabric CA code in the later/latest releases:
https://github.com/hyperledger/fabric-ca/blob/main/go.mod#L17
Fabric v1.4 is deprecated.
Looks like it's tied in here: https://github.com/hyperledger/fabric-ca/blob/main/lib/tls/tls.go#L27-L28
and here: https://github.com/hyperledger/fabric-ca/blob/main/tools/tools.go#L15
Here is what fabric-ca uses from Fabric (from modules.txt):
# github.com/hyperledger/fabric v1.4.11
## explicit
github.com/hyperledger/fabric/bccsp
github.com/hyperledger/fabric/bccsp/factory
github.com/hyperledger/fabric/bccsp/pkcs11
github.com/hyperledger/fabric/bccsp/signer
github.com/hyperledger/fabric/bccsp/sw
github.com/hyperledger/fabric/bccsp/utils
github.com/hyperledger/fabric/common/flogging
github.com/hyperledger/fabric/common/flogging/fabenc
github.com/hyperledger/fabric/common/metrics
github.com/hyperledger/fabric/common/metrics/disabled
github.com/hyperledger/fabric/common/metrics/internal/namer
github.com/hyperledger/fabric/common/metrics/metricsfakes
github.com/hyperledger/fabric/common/metrics/prometheus
github.com/hyperledger/fabric/common/metrics/statsd
github.com/hyperledger/fabric/idemix
The largest use is bccsp (and children packages). Here's what is used from bccsp (not exhaustive but pretty close):
bccsp.BCCSP
bccsp.Key
bccsp.KeyGenOpts
bccsp.SHAOpts
bccsp.X509PublicKeyImportOpts
bccsp.ECDSAKeyGenOpts
bccsp.RSA2048KeyGenOpts
cspsigner.New(c.csp, key)
factory.GetDefault()
factory.FactoryOpts
factory.SwOpts
factory.FileKeystoreOpts{}
factory.GetBCCSPFromOpts(opts)
pkcs11.PKCS11Opts
utils.PEMtoPrivateKey(keyBuff, nil)
utils.PrivateKeyToDER(key)
It looks like the main BCCSP interface is the same between fabric release-1.4
and main
branch which is good news. Things in factory and utils package have changed. I'd suggest to review fabric bccsp (and children) package refactoring that took place in the 2020 commits, and then make the corresponding changes in fabric-ca. We could in theory extract bccsp from fabric and push the common code into fabric-lib-go since that was the initial intent of fabric-lib-go, but that is probably a larger refactoring that can be deferred in the first pass.
github.com/hyperledger/fabric/idemix
has been removed from Fabric but I believe the same functions are now available in the standalone github.com/IBM/idemix
that fabric-ca already depends on. There are not many dependencies in fabric-ca to update for idemix.
I don't think flogging or metrics have changed between fabric release-1.4
and main
branch, or if so, only minimally.
@benjsmi All done! Thanks @celder628 !