Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add handling callback failures section to entropy best practices #548

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions pages/entropy/best-practices.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,21 @@ to submit the necessary transactions.

The gas limit for each chain is listed on the [contract addresses](./contract-addresses) page.

## Handling callback failures

While the default entropy provider is highly reliable, in rare cases a callback might not be received. This typically happens when there's an issue with your contract's callback implementation rather than with the provider itself. The most common causes are:

1. The callback function is using more gas than the allowed limit
2. The callback function contains logic that throws an error

If you're not receiving a callback, you can manually invoke it to identify the specific issue. This allows you to:

- See if the transaction fails and why
- Check the gas usage against the chain's callback gas limit
- Debug your callback implementation

For detailed instructions on how to manually invoke and debug callbacks, refer to the [Debug Callback Failures](./debug-callback-failures) guide.

## 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).
Expand Down
Loading