diff --git a/components/EntropyDeployments.tsx b/components/EntropyDeployments.tsx index 2c06f7d5..95829621 100644 --- a/components/EntropyDeployments.tsx +++ b/components/EntropyDeployments.tsx @@ -163,7 +163,7 @@ export const EntropyDeployments: Record = { "berachain-testnet-v2": { rpc: "https://evm-rpc-bera.rhino-apis.com/", network: "testnet", - delay: "", + delay: "https://bartio.beratrail.io/address/$ADDRESS", address: "0x36825bf3Fbdf5a29E2d5148bfe7Dcf7B5639e320", explorer: "", gasLimit: "500K", @@ -236,7 +236,7 @@ export const EntropyDeployments: Record = { address: "0x23f0e8FAeE7bbb405E7A7C3d60138FCfd43d7509", explorer: "https://testnet-explorer.etherlink.com/address/$ADDRESS", delay: "", - gasLimit: "500K", + gasLimit: "15M", network: "testnet", rpc: "https://node.ghostnet.etherlink.com", }, diff --git a/pages/entropy/best-practices.mdx b/pages/entropy/best-practices.mdx index 8ddf181c..37a4fb43 100644 --- a/pages/entropy/best-practices.mdx +++ b/pages/entropy/best-practices.mdx @@ -1,5 +1,20 @@ # Best Practices +## Limit gas usage on the callback + +Keeping the callback function simple is crucial because the entropy providers limit gas usage. +This ensures gas usage is predictable and consistent, avoiding potential issues with the callback. + +For example, if you want to use entropy to generate a random number for each player in a round of game, +you need to make sure that the callback function works for the maximum number of players that can be in each round. +Otherwise, the callbacks will work for some rounds with fewer players, but will fail for rounds with more players. + +Multiple solutions are possible to address this problem. You can store the random number received from the callback and +either ask users to submit more transactions after the callback to continue the flow or run a background crank service +to submit the necessary transactions. + +The gas limit for each chain is listed on the [contract addresses](./contract-addresses) page. + ## Generating random values within a specific range You can map the random number provided by Entropy into a smaller range using the solidity [modulo operator](https://docs.soliditylang.org/en/latest/types.html#modulo).