hashgraph / hedera-services

Crypto, token, consensus, file, and smart contract services for the Hedera public ledger
Apache License 2.0
299 stars 137 forks source link

Validate that contract expiry state changes have acceptable overhead #3264

Closed tinker-michaelj closed 2 years ago

tinker-michaelj commented 2 years ago

Problem

There is a range of plausible contract expiry scenarios that we want to test the performance impact of.

The load parameters are:

  1. expiriesPerSec - How many contracts are expiring per second.
  2. autoRenewFrac - What fraction of expiring contracts will be auto-renewed instead of permanently removed.
  3. storageUsageDist - The distribution of the expiring contracts' storage usage.
  4. assocTokenDist - The distribution of the expiring contracts' association tokens.
  5. ownedNftsDist - The distribution of the expiring contracts' owned NFTs.

Solution

To validate performance impact, run a mixed load test with ledger.autoRenewPeriod.minDuration=100 and autorenew.gracePeriod=0 with all load parameters set to unrealistically challenging values:

  1. expiriesPerSec=5.
  2. autoRenewFrac=0.6
  3. storageUsageDist=Mult([100, 10k], [0.99, 0.01])
  4. assocTokenDist=Mult([10, 1000], [0.99, 0.01])
  5. ownedNftsDist=Mult([10, 1000], [0.99, 0.01])

Alternatives

No response

tinker-michaelj commented 2 years ago

Tom has run canonical performance tests with contract expiry enabled and all evidence suggests auto-renew/remove work has manageable overhead.