alkem-io / wallet-manager

Wallet management service
European Union Public License 1.2
0 stars 0 forks source link

BUG: DID creation after enabling SSI fails #15

Open valentinyanakiev opened 2 years ago

valentinyanakiev commented 2 years ago

Describe the bug DID creation during server bootstrap fails after enabling SSI

To Reproduce Steps to reproduce the behavior:

  1. On a local setup set SSI_ENABLED=true in your .env file

  2. See error at the logs of the alkemio_dev_wallet_manager_container

    Error: insufficient funds for intrinsic transaction cost (error={"reason":"processing response error","code":"SERVER_ERROR","body":"{\"jsonrpc\":\"2.0\",\"id\":234,\"error\":{\"code\":-32000,\"message\":\"insufficient funds for gas * price + value\"}}","error":{"code":-32000},"requestBody":"{\"method\":\"eth_sendRawTransaction\",\"params\":[\"0xf9010a808504e3b29200830493e094d4351c3f383d79ba378ed1875275b1e7b960f12080b8a45ab5ee37d4eb10816dfe2b0c5f125a1979681d9a9c74a85b9072ff97ff7e8fc3db04b39d0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000002e516d634d4a48693256326143694d69394a755158505045364431557178766e4a45346239596b70667a59714748580000000000000000000000000000000000001ca093206dc739bba8a710b00be7cd74c683035953d943922659f47a28b1067270e2a05ccbf8f266a9f5cb6688c7c7e4d46a2e10355431a13554063047533fac368aba\"],\"id\":234,\"jsonrpc\":\"2.0\"}","requestMethod":"POST","url":"https://rinkeby.infura.io/v3/64fa85ca0b28483ea90919a83630d5d8"}, method="sendTransaction", transaction="0xf9010a808504e3b29200830493e094d4351c3f383d79ba378ed1875275b1e7b960f12080b8a45ab5ee37d4eb10816dfe2b0c5f125a1979681d9a9c74a85b9072ff97ff7e8fc3db04b39d0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000002e516d634d4a48693256326143694d69394a755158505045364431557178766e4a45346239596b70667a59714748580000000000000000000000000000000000001ca093206dc739bba8a710b00be7cd74c683035953d943922659f47a28b1067270e2a05ccbf8f266a9f5cb6688c7c7e4d46a2e10355431a13554063047533fac368aba", code=INSUFFICIENT_FUNDS, version=providers/5.5.0)
    at Logger.makeError (/usr/src/app/node_modules/@ethersproject/logger/lib/index.js:199:21)
    at Logger.throwError (/usr/src/app/node_modules/@ethersproject/logger/lib/index.js:208:20)
    at checkError (/usr/src/app/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:95:16)
    at JsonRpcProvider.<anonymous> (/usr/src/app/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:659:47)
    at step (/usr/src/app/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:48:23)
    at Object.throw (/usr/src/app/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:29:53)
    at rejected (/usr/src/app/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:21:65)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5) {
    reason: 'insufficient funds for intrinsic transaction cost',
    code: 'INSUFFICIENT_FUNDS',
  3. See the logs at the server:

[NestWinston] Verbose   3/8/2022, 11:52:07 AM [api] AsyncFunction-AgentService-createDidOnAgent: Execution time: 33707.941 milliseconds - {}
[NestWinston] Verbose   3/8/2022, 11:52:39 AM [api] AsyncFunction-AgentService-createDidOnAgent: Execution time: 31580.416 milliseconds - {}
[NestWinston] Verbose   3/8/2022, 11:53:09 AM [api] AsyncFunction-AgentService-createDidOnAgent: Execution time: 30453.867 milliseconds - {}
[NestWinston] Verbose   3/8/2022, 11:53:18 AM [api] AsyncFunction-AgentService-createDidOnAgent: Execution time: 9475.836 milliseconds - {}
[NestWinston] Verbose   3/8/2022, 11:53:54 AM [api] AsyncFunction-AgentService-createDidOnAgent: Execution time: 35638.396 milliseconds - {}

Creating DIDs is synchronous and takes ages, blocking the server.

Expected behavior

The DID creation process shouldn't block the server and wallet manager should be able to create DIDs on agents.

welcome[bot] commented 2 years ago

Thanks for opening your first issue here! Be sure to follow the issue template!