Defender - DynamoDB Error

Hey there, I am creating a deployment script that uses the Defender Relay. The idea is to use the relay to pay for all the transactions, but I am currently getting the following error:

Error: Returned error: {"id":960,"jsonrpc":"2.0","result":null,"error":"Throughput exceeds the current capacity of your table or index. DynamoDB is automatically scaling your table or index so please try again shortly. If exceptions persist, check if you have a hot key: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-partition-key-design.html"}

:computer: Environment

  • defender-relay-client: 1.12.1
  • truffle: 5.4.29
  • network: rinkeby

:memo:Details
The deployment script is triggered using Truffle Migrations. It starts fine, deploys some contracts and suddenly returns that error. Apparently it is being throttled by the AWS.

The idea is to automate the deployment of several contracts (+40) and use the Defender Relayer to pay for these transactions.

In addition to that, the Relay is instantiated as a web3 provider in the truffle-config.js:

const provider = new DefenderRelayProvider(
    {
      apiKey: process.env.DEFENDER_API_KEY,
      apiSecret: process.env.DEFENDER_API_SECRET,
    },
    {
      speed: "fast",
    }
  );

Any ideas?

Thank you!

Hey @fforbeck, we got this issue identified and a fix ready to be rolled out this week. In the meantime, I'd suggest to add a sleep of a second inbetween each contract.

Sounds good. Thanks @spalladino !

1 Like

Hey @fforbeck, we deployed a fix for this yesterday. Can you let us know if you run into this again?

That worked, @spalladino ! Thanks.
qq: do you guys have some sort of hardhat plugin for the Defender Relayer?
I was wondering if we can enable the relayer directly in the hardhat initialization, and set the DefenderRelayProvider as the default provider for all txs.

No, but it's a good idea! I just created an issue for that on the relay-client repository.