-
Notifications
You must be signed in to change notification settings - Fork 24
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
refactor(move-sdtlib): minimize calls to length in vector functions #5723
Merged
nonast
merged 7 commits into
vm-lang/upstream-nov-dic-24
from
vm-lang/issue-5253-minimize-calls-to-length
Mar 3, 2025
Merged
refactor(move-sdtlib): minimize calls to length in vector functions #5723
nonast
merged 7 commits into
vm-lang/upstream-nov-dic-24
from
vm-lang/issue-5253-minimize-calls-to-length
Mar 3, 2025
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 4 Skipped Deployments
|
…nimize-calls-to-length
valeriyr
approved these changes
Mar 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Co-authored-by: Valerii Reutov <valeriy.reutov@gmail.com>
jkrvivian
approved these changes
Mar 3, 2025
miker83z
added a commit
that referenced
this pull request
Mar 20, 2025
* feat(docs/random): update docs realted to randomness (#5388) * feat(iota-framework/move-stdlib): Deprecated `fixed_point32` (#5193) * feat(iota-framework/move-stdlib): Deprecated `fixed_point32`, new type implemented uq32_32 * fix(iota-execution/crypto): update fastcrypto pointer and bls12381 scalar length path (#5378) * fix(iota-execution/crypto): update fastcrypto pointer and bls12381 scalar length path * bump to protocol v5 * update framework snapshot * fix protocol version and snapshots * fix iota-swarm * fix(iota-benchmark): update simtest max protocol version * revert MAX_ALLOWED msim fake version removal * fix(move-stdlib): print string instead of bytes (#5446) * fix(iota-framework/packges): update some calls to is empty in loops (#5403) * fix(iota-framework/packages): optimizes some calls to `is_empty` in loop conditions. This saves on the function call overhead and uses the bytecode instruction directly. * fix(iota-framework): check for IOTA in private balance functions (#5489) * fix(iota-framework): check for IOTA in private balance functions * feat(iota-framework-snapshot): the snapshots update * fix(iota-framework): check for IOTA in `destroy_genesis_supply` * feat(iota-framework-snapshot): the snapshots update * fix(iota-swarm-config): update the baseline * fix(iota-framework): update the compiled packages * feat(iota-framework-snapshot): the snapshots update * fix(iota-swarm-config): update the baseline --------- Co-authored-by: Mirko Zichichi <miker83z@proton.me> * fix(iota-framework/move-stdlib,crypto): Assertions for groth16 public inputs parser, snapshot regenerating (#5432) * fix(iota-framework/move-stdlib,crypto): Assertions for groth16 public inputs parser, snapshot regenerating * feat(iota-framework/move-stdlib): add to_string method for integer types (#5517) * feat(iota-framework/move-stdlib): add to_string method for integer types * feat: disallow new modules from being added to packages in deps-only mode (#5481) * feat(iota-framework): add get_validator_address_by_pool_id function (#5377) * feat(iota-framework): add get_validator_address_by_pool_id function * chore: update snapshots * chore: update bytecode snapshot and manifest * update swarm config snapshot * chore: update snapshot and binaries * chore: update iota-framework-snapshot files * chore: update swarm snapshot * chore: update iota-framework-snapshot manifest * chore: update swarm snapshot * chore: update iota-framework-snapshot manifest * chore: update snapshot * chore: update manifest --------- Co-authored-by: Mirko Zichichi <miker83z@proton.me> Co-authored-by: miker83z <mirko.zichichi@iota.org> * feat(iota-transactional-test-runner): add sponsor and gas payment for transactional-test-runner (#5518) * feat(iota-transactional-test-runner): Add a way to create programmable transactions with gas from a sponsor address, rather than a sender address Add the ability to specify an explicit gas payment object to a programmable transaction in transactional test runner * fmt * cargo lock * fix(iota-move): update move command to use module labels, generate-struct-layouts fix (#5592) * fix(iota-move): update move command to use module labels, generate-struct-layouts fix * feat(iota-framework/move-stdlib): add new uq64_64 type, minor updates u128 (#5597) * feat(iota-framework/move-stdlib): add new uq64_64 type, minor updates u128 * feat(framework): add fun bitwise_not and macro fun max_value (#5589) * feat(move-stdlib): add fun bitwise_not and macro fun max_value * chore: update compiled binaries and published api * chore: update snapshot * chore: update iota-swarm-config snapshot * chore: update manifest * fix: remove duplicate macro fun * chore: update compiled packages and swarm snapshot * chore: update snapshot and manifest * chore: update swarm snapshot * chore: update manifest * feat(iota-protocol, iota-execution, iota-framework): Update signing verifier constants setting (#5588) * feat(iota-protocol, iota-execution, iota-framework): allowing verifier constants for limits and metering to be set by the node config instead of being hardcoded into the binary * fix(iota, iota-move, iota-framework-tests): removes the feature flags for the `iota-move` crate (#5634) * feat(iota-framework, iota-move-natives): introduces a new uncompressed representation of BLS12381-G1 (#5630) * feat(iota-framework, iota-move-natives): introduces a new uncompressed representation of BLS12381-G1 elements and a function to add a vector of uncompressed elements * feat(iota-procotol, iota-adapter-tx-tests): Update how we handle type errors in some commands (#5664) * feat(iota-procotol, iota-adapter-tx-tests): Update how we handle type errors in some commands * feat: gas logic tweaks and cleanups (#5594) * feat: gas logic tweaks and cleanups * fix: pulled the uncompressed G1 group changes * chore(iota-framework, docs): add iota-swarm-config test to contributing.md (#5646) * refactor(move-sdtlib): minimize calls to length in vector functions (#5723) * refactor(move-stdlib): minimize calls to length in vector functions * chore: add docs to protocol-config * chore: update iota-adapter-transactional-tests and compiled move-stdlib * chore: update iota-framework-snapshot * chore: update manifest * Update crates/iota-protocol-config/src/lib.rs Co-authored-by: Valerii Reutov <valeriy.reutov@gmail.com> --------- Co-authored-by: Valerii Reutov <valeriy.reutov@gmail.com> * feat: bump version to 0.11.0-alpha with protocol version 5 revert: removal of fake `MAX_ALLOWED` for tests * fix(iota-framework): audit issue 58 extra mutable self in coin manager (#5447) * fix(iota-framework): use immutable self in `coin_manager::additional_metadata` * feat(iota-framework-snapshot): the snapshots update * fix(iota-swarm-config): update the baseline * fix(iota-framework): add `coin_manager::get_additional_metadata` * feat(iota-framework-snapshot): the snapshots update * fix(iota-swarm-config): update the baseline * feat(protocol): PCR-2 (#5479) * PCR-2 base changes * transaction-fuzzer changes * comment construct_advance_epoch_pt_* functions * iota-adapter-transactional-tests changes (#5283) Co-authored-by: Mirko Zichichi <miker83z@proton.me> * feat(protocol): PCR-2 iota-json-rpc* and iota-open-rpc (#5277) * iota-json-rpc* and iota-open-rpc changes * refactor(protocol): pcr2 more base changes (#5448) * feat: implement conversions between v1 and v2 for system-state summary * refactor(types): add non_exhaustive attribute to IotaSystemStateSummary * refactor(core): use system-state summary v2 * doc(type): fix typo in system-state summary v2 doc * refactor(json-rpc): support new system state summary (#5449) * feat(json-rpc-api): support all versions of system-state summary * refactor(json-rpc): support v2 of system-state summary * chore(open-rpc): update specification --------- Co-authored-by: Konstantinos Demartinos <konstantinos.demartinos@iota.org> * feat(protocol): PCR-2 iota-rest-api (#5276) * iota-rest-api changes * refactor(rest-api): use v2 of system state summary (#5455) --------- Co-authored-by: Konstantinos Demartinos <konstantinos.demartinos@iota.org> * feat(protocol): PCR-2 iota-proxy (#5461) * feat(protocol): PCR-2 iota-sdk (#5467) * feat(protocol): PCR-2 iota-sdk * more examples fix * feat(protocol): PCR-2 iota-indexer (#5278) * iota-indexer changes * refactor(indexer): use new system state summary (#5477) * refactor(indexer): add burned computation cost to schema * refactor(indexer)!: use new system-state summary type * Update crates/iota-indexer/src/handlers/checkpoint_handler.rs Co-authored-by: Thoralf-M <46689931+Thoralf-M@users.noreply.github.com> --------- Co-authored-by: Konstantinos Demartinos <konstantinos.demartinos@iota.org> Co-authored-by: Thoralf-M <46689931+Thoralf-M@users.noreply.github.com> * feat(protocol): PCR-2 iota-bridge-cli/iota-tool (#5478) * feat(protocol): PCR-2 iota-bridge-cli * iota-tool * refactor(types): derive serde and clone for IotaSystemStateSummary * iota-analytics-indexer changes (#5282) * feat(protocol): PCR-2 iota-graphql-rpc (#5280) * iota-graphql-rpc changes * feat(indexer): add computation_cost_burned getter * refactor(graphql-rpc): use the new system-state summary --------- Co-authored-by: Konstantinos Demartinos <konstantinos.demartinos@iota.org> * refactor(transactional-test-runner): use new system-state summary type (#5501) * fix(indexer): get system summary conditionally in index_epoch * refactor(iota): use new system-state summary type (#5502) * refactor(rosetta): use new system-state summary (#5507) * refactor(graphql-e2e-tests: update baselines (#5281) Co-authored-by: Konstantinos Demartinos <konstantinos.demartinos@iota.org> * refactor(json-rpc-tests): use new system-state summary * feat(protocol): PCR-2 iota-benchmark and iota-cluster-test (#5516) * refactor(iota-benchmark): use new system-state summary type * refactor(iota-cluster-test): use new system-state summary type * fix: clippy error * feat(protocol): PCR-2 iota-e2e-tests (#5520) * refactor(iota-e2e-tests): use new system-state summary type * fix: never trust the autocomplete... * fix: typo * fix: fix `IotaSystemStateV2` docstring * fix: missing IotaSystemStateSummary in iota-e2e-tests simtests * chores: Update system package build and snapshot * chores: Update snapshot in iota-swarm-config * Revert manifest.json in iota-framework-snapshot * docs: Fix doc comments in iota_system_state_inner_v2.rs --------- Co-authored-by: jkrvivian <jkrvivian@gmail.com> * refactor(json-rpc,indexer): add get_latest_iota_system_state_v2 (#5586) * refactor(json-rpc-api): add get_latest_iota_system_state_v2 * refactor(indexer): use get_latest_iota_system_state_v2 * refactor(json-rpc-api): add deprecated rust attribute * Tokenomics documentation update (#5271) * Initial commit tokenomics documentation update * docs(tokenomics): first round of changes in tokenomics.mdx and gas-in-iota.mdx * gas pricing updates * Solved merge conflict * Solved merge conflict * staking changes * docs(tokenomics): review iota-token and proof-of-stake * docs(tokenomics): review validators-staking * docs(tokenomics): review staking-unstaking * docs(tokenomics): review gas-pricing * docs(tokenomics): review gas-in-iota * Tokenomics home page fix * Remove redundant text related to token utilization * Minor changes to tokenomics docs * Update docs/content/about-iota/tokenomics/tokenomics.mdx Co-authored-by: Lucas Tortora <85233773+lucas-tortora@users.noreply.github.com> * Style and naming changes in gas pricing file * fix inflation rate value * Update docs/content/_snippets/staking-pool-reqs.mdx Co-authored-by: Lucas Tortora <85233773+lucas-tortora@users.noreply.github.com> * Update docs/content/about-iota/tokenomics/gas-pricing.mdx Co-authored-by: Lucas Tortora <85233773+lucas-tortora@users.noreply.github.com> * tweaks to tokenomics homepage * Update tokenomics image * update tokenomics image --------- Co-authored-by: Roman Overko <roman.overko@iota.org> Co-authored-by: Andrew <i.am.andrew.cullen@gmail.com> Co-authored-by: Can <canumutileri@gmail.com> Co-authored-by: Lucas Tortora <85233773+lucas-tortora@users.noreply.github.com> Co-authored-by: Lucas Tortora <lucas.tortora@iota.org> Co-authored-by: Andrew Cullen <45826600+cyberphysic4l@users.noreply.github.com> * refactor(iota-sdk): version get_latest_iota_system_state (#5587) * refactor(json-rpc-api): add get_latest_iota_system_state_v2 * refactor(indexer): use get_latest_iota_system_state_v2 * refactor(iota-sdk): version get_latest_iota_system_state * refactor(iota-sdk): use get_latest_iota_system_state_v2 if available in the rpc_methods * refactor(iota-sdk): cache iota_system_state_v2_support * fix: use get_latest_iota_system_state_v2 in tests * fix: update remaining tests to get_latest_iota_system_state_v2 --------- Co-authored-by: Thoralf Müller <thoralf.mue@gmail.com> Co-authored-by: Thoralf-M <46689931+Thoralf-M@users.noreply.github.com> * refactor(simulacrum): use ChangeEpochV2 * chore(json-rpc-api,open-rpc): correct supported protocol version in docs * feat(ts-sdk): update TS SDK after PCR2 changes (#5637) * feat(update-tssdk-types): Run update-open-rpc-client-types * feat(update-tssdk-types): Support versioned system state. Sdk build passing. Updates version.ts. * feat(update-tssdk-types): Bump graphql schema version (2025.2) and run update-graphql-schemas * feat(update-tssdk-types): Run graphql-transport codegen * feat(update-tssdk-types): Fix IotaSystemStateSummary type mismatch in graphql-transport * feat(update-tssdk-types): Support getLatestIotaSystemStateV2 in TS client and adjust * feat(update-tssdk-types): Fix turbo build & lint for apps * feat(ts-sdk): Add changeset * Update sdk/typescript/src/client/client.ts comment to align with openrpc.json Co-authored-by: Begoña Álvarez de la Cruz <balvarez@boxfish.studio> * feat(ts-sdk): dprint * feat(ts-sdk): dprint --------- Co-authored-by: Begoña Álvarez de la Cruz <balvarez@boxfish.studio> --------- Co-authored-by: Alexander Sporn <github@alexsporn.de> Co-authored-by: Mirko Zichichi <miker83z@proton.me> Co-authored-by: Konstantinos Demartinos <konstantinos.demartinos@iota.org> Co-authored-by: muXxer <mux3r@web.de> Co-authored-by: Thibault Martinez <thibault@iota.org> Co-authored-by: Thoralf-M <46689931+Thoralf-M@users.noreply.github.com> Co-authored-by: jkrvivian <jkrvivian@gmail.com> Co-authored-by: Luigi Vigneri <luigivigneri89@gmail.com> Co-authored-by: Roman Overko <roman.overko@iota.org> Co-authored-by: Can <canumutileri@gmail.com> Co-authored-by: Lucas Tortora <85233773+lucas-tortora@users.noreply.github.com> Co-authored-by: Lucas Tortora <lucas.tortora@iota.org> Co-authored-by: Thoralf Müller <thoralf.mue@gmail.com> Co-authored-by: Mario <mario.sarcevic@iota.org> Co-authored-by: Begoña Álvarez de la Cruz <balvarez@boxfish.studio> * fix(iota-move/docs): Add Conventions as comments to a new package when `iota move new` (#5724) * update protocol snapshots * refactor validator_address_by_pool_id for IotaSystemStateV2 * update framework snapshots * fix fmt * fix clippy * update swarm config snapshot * re-build framework packages * update framework snapshots * update protocol snapshots * update CONTRIBUTING readme in framework to use the snapshots script * revert iota-system/delegation_tests changes * update graphql-e2e-test baselines --------- Co-authored-by: Pavlo Botnar <pavlo.botnar@gmail.com> Co-authored-by: Nonast <29281463+nonast@users.noreply.github.com> Co-authored-by: Valerii Reutov <valeriy.reutov@gmail.com> Co-authored-by: Alexander Sporn <github@alexsporn.de> Co-authored-by: Andrew Cullen <45826600+cyberphysic4l@users.noreply.github.com> Co-authored-by: Konstantinos Demartinos <konstantinos.demartinos@iota.org> Co-authored-by: muXxer <mux3r@web.de> Co-authored-by: Thibault Martinez <thibault@iota.org> Co-authored-by: Thoralf-M <46689931+Thoralf-M@users.noreply.github.com> Co-authored-by: jkrvivian <jkrvivian@gmail.com> Co-authored-by: Luigi Vigneri <luigivigneri89@gmail.com> Co-authored-by: Roman Overko <roman.overko@iota.org> Co-authored-by: Can <canumutileri@gmail.com> Co-authored-by: Lucas Tortora <85233773+lucas-tortora@users.noreply.github.com> Co-authored-by: Lucas Tortora <lucas.tortora@iota.org> Co-authored-by: Thoralf Müller <thoralf.mue@gmail.com> Co-authored-by: Mario <mario.sarcevic@iota.org> Co-authored-by: Begoña Álvarez de la Cruz <balvarez@boxfish.studio>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
sc-platform
Issues related to the Smart Contract Platform group.
vm-language
Issues related to the VM & Language Team
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of change
Calling length in a loop is less gas and wall time efficient than calling it once and using a simple loop.
Links to any relevant issues
fixes #5253
Type of change
Choose a type of change, and delete any options that are not relevant.
How the change has been tested
Describe the tests that you ran to verify your changes.
Make sure to provide instructions for the maintainer as well as any relevant configurations.
Change checklist
Tick the boxes that are relevant to your changes, and delete any items that are not.