Closed ghost closed 2 years ago
Hey team! Please add your planning poker estimate with ZenHub @apoorv-2204 @blackode @imnik11 @roychowdhuryrohit-dev @samuel-uniris
example of stress test done with benchee:
Archethic.Crypto.NodeKeystore.Origin.TPMImpl.start_link()
Archethic.Crypto.NodeKeystore.SoftwareImpl.start_link()
# Benchmarks with sequential calls for both software and hardware keys
Benchee.run(%{
"sign with origin key" => fn data ->
Archethic.Crypto.NodeKeystore.Origin.TPMImpl.sign_with_origin_key(data)
end,
"sign with software key" => fn data ->
Archethic.Crypto.NodeKeystore.SoftwareImpl.sign_with_last_key(data)
end
}, inputs: %{
"with hash of 256bits" => :crypto.strong_rand_bytes(32)
})
# Benchmarks with parallel calls for both software and hardware keys
Benchee.run(%{
"sign with origin key" => fn data ->
Archethic.Crypto.NodeKeystore.Origin.TPMImpl.sign_with_origin_key(data)
end,
"sign with software key" => fn data ->
Archethic.Crypto.NodeKeystore.SoftwareImpl.sign_with_last_key(data)
end
}, inputs: %{
"with hash of 256bits" => :crypto.strong_rand_bytes(32)
}, parallel: System.schedulers_online())
# Benchmarks with high parallelism for software keys
Benchee.run(%{
"sign with software key" => fn data ->
Archethic.Crypto.NodeKeystore.SoftwareImpl.sign_with_last_key(data)
end
}, inputs: %{
"with hash of 256bits" => :crypto.strong_rand_bytes(32)
}, parallel: System.schedulers_online() * 4)
To avoid any scalability issue and throughput improvements, we have to implement a new scheme for node cryptography where hardware keys are use for the node transaction chain but still using software keys to support fast signing and decryption.
So a node transaction will be build with:
Then we should: