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

chore(deps): bump warp-contracts from 1.4.26 to 1.4.28 #164

Merged

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Dec 15, 2023

Bumps warp-contracts from 1.4.26 to 1.4.28.

Release notes

Sourced from warp-contracts's releases.

Support for AbortSignal and batch processing

This release adds 2 new features:

1. Support for AbortSignal:

The methods: readState, readStateFor, viewState have now an optional parameter signal: AbortSignal https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal). The main usecase is an ability to stop the contract evaluation in case it takes too much time:

const signal = AbortSignal.timeout(2000);
const contract = warp.contract("Daj-MNSnH55TDfxqC7v4eq0lKzVIwh98srUaWqyuZtY");
const result = await contract.readStateBatch(null, null, signal);

If the AbortSignal is triggered - the SDK will throw AbortError.

You can also use AbortController to have a full control over when the processing will be aborted, e.g in UI.:

const controller = new AbortController();
const signal = controller.signal;
const abortBtn = document.querySelector(".abort");
abortBtn.addEventListener("click", () => {
controller.abort();
});
const contract = warp.contract("Daj-MNSnH55TDfxqC7v4eq0lKzVIwh98srUaWqyuZtY");
const result = await contract.readStateBatch(null, null, signal);

2. Support for batch processing:

A new method has been added to the Contract interface:

readStateBatch(pagesPerBatch: number, signal: AbortSignal): Promise<SortKeyCacheResult<EvalStateResult<State>>>

This method is helpfull for evaluating contracts with a large amount of interactions. Instead of loading all of the contract's interactions first and then evaluting them (which might consume a LOT of memory) - the SDK (when this new method is used) first loads the amount of interactions pages specified in the pagesPerBatch parameter, evaluates them, loads next batch of interactions, etc...

The parameter pagesPerBatch defines how many pages of interactions the implementation of the InteractionsLoader will load. E.g.:

  1. if the WarpGatewayInteractionsLoader is being used (the default in case of forMainnet Warp instance) - each page contains at most 5000 interactions. So for the pagesPerBatch = 1, the SDK will load 5000 interactions, evaluate them, store the result in cache, load another 5000 interactions, etc. For the pagesPerBatch = 3, the SDK will load 15000 interactions, evaluate them, load next 15000 interactions, etc.

  2. if the ArweaveGatewayInteractionsLoader is being used - each page contains at most 100 interactions. So for the pagesPerBatch = 1, the SDK will load 100 interactions, evaluate them, store the result in cache, load another 100 interactions, etc.
    For pagesPerBatch = 5 - it will load 500 interactions, evaluate them, load another 500 interactions, etc..

Interaction input in data field

According to the SmartWeave protocol, input of the interaction can be stored in its tags, more specifically - in the Input tag. However, we are then limited by the transaction tag’s size limit - 4kb for the transaction (including all the default tags that Warp applies). Due to this problem, a new way of storing input - in the data field of the transaction - was introduceed in Warp. It does not require any changes from the user perspective. Warp SDK checks the input size and decide wether it should be placed in the tag or - if it exceeds the limit - in the data field of the transaction. Interaction is then sent to the Warp Sequencer and indexed as usual - so it is available in all of the Warp tools as it’s been before. Particularly - contract state of the contract is evaluated regardless of the input type.

A new tag - Input-Format has been added to the interaction. It is set to either tag or data depending on the way of storing input.

... (truncated)

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [warp-contracts](https://github.com/warp-contracts/warp) from 1.4.26 to 1.4.28.
- [Release notes](https://github.com/warp-contracts/warp/releases)
- [Commits](warp-contracts/warp@v1.4.26...v1.4.28)

---
updated-dependencies:
- dependency-name: warp-contracts
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Dec 15, 2023
@github-actions github-actions bot merged commit eea9ec3 into master Dec 15, 2023
4 checks passed
@dependabot dependabot bot deleted the dependabot/npm_and_yarn/warp-contracts-1.4.28 branch December 15, 2023 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants