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: made ProposedUpdates use IterableMap underneath due contracts taking too much space #737

Merged
merged 4 commits into from
Jul 29, 2024

Conversation

ChaoticTempest
Copy link
Member

  • Reorganized tests in contracts/tests
  • Added test for proposing multiple contracts such that we don't run into the case where contracts are being loaded at every state load into memory; and then costing us a lot of gas per function call.
  • ProposedUpdates now uses IterableMap internally due to the above.

@ChaoticTempest ChaoticTempest requested review from volovyks and ppca July 27, 2024 08:37
@ChaoticTempest
Copy link
Member Author

@ppca this is a breaking change for RC1

Copy link
Collaborator

@volovyks volovyks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

let execution = accounts[0]
.call(contract.id(), "propose_update")
.args_borsh((ProposeUpdateArgs {
code: Some(vec![0; 3900 * 1024]),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it the size of our contract? Or max size of contract on NEAR?

vote_update_till_completion(&contract, &accounts, proposals.last().unwrap()).await;

// Let's check that we can call into the state and see all the proposals.
let state: mpc_contract::ProtocolContractState =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we check the state?

@volovyks volovyks merged commit d368dd5 into develop Jul 29, 2024
4 checks passed
@volovyks volovyks deleted the phuong/chore/more-contract-tests branch July 29, 2024 09:30
Copy link

Terraform Feature Environment Destroy (dev-737)

Terraform Initialization ⚙️success

Terraform Destroy success

Show Destroy Plan


No changes. No objects need to be destroyed.

Either you have not created any objects yet or the existing objects were
already deleted outside of Terraform.

Destroy complete! Resources: 0 destroyed.

Pusher: @volovyks, Action: pull_request, Working Directory: ``, Workflow: Terraform Feature Env (Destroy)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants