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

Feature/plmc 391 allow parallel instantiaton of projects #130

Merged
merged 121 commits into from Jan 16, 2024

Conversation

JuaniRios
Copy link
Contributor

@JuaniRios JuaniRios commented Dec 15, 2023

What

  1. Every participant has to make a one-time deposit to cover their pallet-assets storage for each contribution token. Linear issue
  2. When compiling the node with std, we can now define a genesis config of pallet-funding, which will instantiate any project at any stage, with any participations/evaluations. The syntax is the same as used in the Instantiator. Linear issue
  3. The Issuer needs to pay for the ExistentialDeposit of the escrow account for their project. Found the bug while doing the previous item.

Why

  1. This fixes the problem where a participant could only have a limited amount of different (i.e separate projects) contribution tokens related StackExchange post
  2. To start testing the blockchain with the UI, we need to spin up projects at different stages several times. Now we avoid wasting time manually creating every project every time we spin up a node.
  3. Accounts need always some minimal deposit to exist. We didn't catch this bug before because the derivation for escrow accounts we used made it so the escrow for project 0, was equal to the pallet-funding system account. And that one we always funded at Genesis.

How

  1. In every participation and evaluation extrinsic, we check if the user has already a deposit for that project_id. If not we reserve it for him. That amount will be used to call the touch() extrinsic of pallet-assets which pays for storage, if the project succeeds. If the project fails then it is returned to the user.
    The return has been implemented in the Cleaner.
  2. New asynchronous functions now live in the instantiator. We have a controller which is in charge of advancing blocks, and resuming execution of the different project creation functions that live in separate tasks.
    This way, before continuing advancing blocks for a project, we can stop and resume execution of other projects that wanted to execute in that block.
  3. When calling create(), the amount is transferred from the issuer to the escrow, which will make the extrinsic fail if the issuer doesn't have enough funds

Testing

  1. ct_account_deposits_are_returned tests written for evaluations, bids, and contributions. They test both the locking up and the automatic release of the plmc when the project fails.
  2. There are 2 tests created when prototyping which use different abstraction levels (prototype_1(), prototype_2()). And one test which calls the genesis config, which is the outcome we wanted to test (genesis_parallel_instantiaton()).
    It happened that the genesis pallet test passed, but when running the real node it failed. Because of this also a test inside integration-tests was written, which calls the node directly and tries building the raw spec. It lives inside build_spec.rs. Note you should have the node compiled with std (and fast-gov to make it faster) at the target/release folder.
  3. issuer_cannot_pay_for_escrow_ed tests that the creation function fails if the issuer doesn't have enough funds to pay to the escrow for its creation

Anything else?

  1. Maybe I should write a test that the ct deposit was used successfully. But this is tested already in every project creation function when checking for correct balances before and after creation.
  2. Note that USDT and USDC pallet-asset accounts will be created by increasing the consumer account of that escrow. But since we don't expect many funding assets at the beginning, it should be fine for now.

Addendum

  • Testing-node feature is now removed. The "std" flag should be used to be able to pass an externality to the instantiator
  • Benchmarks on pallet-funding are broken, but will be fixed in PLMC-373

automatic hrmp connection working

Genesis instantiator usage and first draft of HRMP connection

formatting

feature propagation

cleanup

new node functioning. genesis not yet sure if working

new node functioning. genesis not yet sure if working

somehow compiling and test passing

save

save

save

feat(287): para_id setting extrinsic implemented and tested

save

same log crate across workspace

same log crate across workspace

save

save

save

feat(287): changed tight couple of pallet_xcm by extracting sender trait

feat(287): first commit

feat(285): POC Hrmp automatic acceptance
# Conflicts:
#	Cargo.lock
#	Cargo.toml
#	integration-tests/src/tests/mod.rs
#	pallets/funding/Cargo.toml
#	pallets/funding/src/functions.rs
#	pallets/funding/src/instantiator.rs
#	pallets/funding/src/lib.rs
#	pallets/funding/src/mock.rs
#	pallets/funding/src/types.rs
#	pallets/xcm-executor/src/config.rs
#	pallets/xcm-executor/src/lib.rs
#	runtimes/standalone/src/lib.rs
#	runtimes/testnet/src/xcm_config.rs
…s-polimecs-balance-and-pallet

# Conflicts:
#	Cargo.toml
… new map of query id -> unconfirmed transactions
@JuaniRios JuaniRios marked this pull request as ready for review January 8, 2024 16:36
Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>
Copy link
Collaborator

@vstam1 vstam1 left a comment

Choose a reason for hiding this comment

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

I think there are two big things that I like to discuss with you:

  1. Lets go over the multiple project instantiation together as its not completely clear to me how it works with async/multithread instantiation.
  2. As far as I currently understand we add a list of accountIds to the projectDetails storage via the cleaner. Not completely sure how it encodes it in scale but if it would encode all the accountIds that still need to be refunded for ct deposit, it would bloat the total storage of the ProjectDetails. If we really need to store it instead of calculating it on the fly, I would like to see it getting stored in a separate storage item.

integration-tests/src/tests/build_spec.rs Show resolved Hide resolved
integration-tests/src/tests/ct_migration.rs Outdated Show resolved Hide resolved
integration-tests/src/tests/ct_migration.rs Outdated Show resolved Hide resolved
integration-tests/src/tests/ct_migration.rs Show resolved Hide resolved
integration-tests/src/tests/oracle.rs Show resolved Hide resolved
pallets/funding/src/genesis_config.rs Outdated Show resolved Hide resolved
pallets/funding/src/instantiator.rs Outdated Show resolved Hide resolved
pallets/funding/src/lib.rs Show resolved Hide resolved
pallets/funding/src/mock.rs Outdated Show resolved Hide resolved
pallets/funding/src/lib.rs Outdated Show resolved Hide resolved
Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>
Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>
Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>
Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>
Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>
Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>
Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>
Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>
…ent).

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>
#130 (comment)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>
… ["std"]"` in Cargo.toml

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>
…-of-projects

# Conflicts:
#	integration-tests/src/tests/defaults.rs
#	runtimes/testnet/src/lib.rs
Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>
Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>
Co-authored-by: Leonardo Razovic <4128940+lrazovic@users.noreply.github.com>
Comment on lines 274 to 285
use pallet_funding::{instantiator::UserToUSDBalance, *};
#[cfg(all(feature = "testing-node", feature = "std"))]
use sp_runtime::BoundedVec;

#[cfg(all(feature = "testing-node", feature = "std"))]
#[cfg(feature = "std")]
mod testing_helpers {
use super::*;
use frame_benchmarking::frame_support::assert_ok;
use macros::generate_accounts;
use polimec_parachain_runtime::AccountId;
use sp_core::H256;
use sp_runtime::traits::ConstU32;
use sp_runtime::{traits::ConstU32, FixedU128};
use std::collections::HashMap;
Copy link
Contributor

@lrazovic lrazovic Jan 16, 2024

Choose a reason for hiding this comment

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

This should remove the warnings at compile time.

(Please test if everything still works. I tested with cargo b -r and cargo b -r --features std, but I may missed some other features)

Suggested change
use pallet_funding::{instantiator::UserToUSDBalance, *};
#[cfg(all(feature = "testing-node", feature = "std"))]
use sp_runtime::BoundedVec;
#[cfg(all(feature = "testing-node", feature = "std"))]
#[cfg(feature = "std")]
mod testing_helpers {
use super::*;
use frame_benchmarking::frame_support::assert_ok;
use macros::generate_accounts;
use polimec_parachain_runtime::AccountId;
use sp_core::H256;
use sp_runtime::traits::ConstU32;
use sp_runtime::{traits::ConstU32, FixedU128};
use std::collections::HashMap;
mod testing_helpers {
use super::*;
use macros::generate_accounts;
pub use pallet_funding::{instantiator::UserToUSDBalance, *};
use polimec_parachain_runtime::AccountId;
use sp_core::H256;
pub use sp_runtime::{traits::ConstU32, BoundedVec, FixedU128};

Copy link
Contributor Author

Choose a reason for hiding this comment

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

addressed in c3f801e

Copy link
Contributor

@lrazovic lrazovic left a comment

Choose a reason for hiding this comment

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

I focused my review on the no-std part and the node, since I don't have enough experience with tokio to give a valuable feedback, but from what I have seen it looks definitely interesting.

We can probably improve the propagation of the std feature in the node since it should be on by default at that stage. Maybe we can take a cue from https://github.com/KILTprotocol/kilt-node/blob/b8a22b85fad24d88c2849f6430f8b6019522fd25/nodes/parachain/Cargo.toml#L52-L63

Nevertheless LGTM, with only one nit: #130 (comment)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>
@JuaniRios JuaniRios merged commit b107139 into main Jan 16, 2024
@JuaniRios JuaniRios deleted the feature/plmc-391-allow-parallel-instantiaton-of-projects branch January 16, 2024 16:35
JuaniRios added a commit that referenced this pull request Jan 16, 2024
* feat(287): parachain information discovery and channel opening

automatic hrmp connection working

Genesis instantiator usage and first draft of HRMP connection

formatting

feature propagation

cleanup

new node functioning. genesis not yet sure if working

new node functioning. genesis not yet sure if working

somehow compiling and test passing

save

save

save

feat(287): para_id setting extrinsic implemented and tested

save

same log crate across workspace

same log crate across workspace

save

save

save

feat(287): changed tight couple of pallet_xcm by extracting sender trait

feat(287): first commit

feat(285): POC Hrmp automatic acceptance

* first commit

* save

* penpal local fork

* save

* save

* save

* HRMP establishment successfully mocked!

* pallet-funding tests fixed

* migration check working

* fixes

* add cargo lock

* dmp fix

* formatting

* small fixed

* fixes

* save

* compiling, unit converion to map

* revert staking changes

* saving now evaluation reward and move to u64 for migration

* save

* save

* migration is successfully sent and reflected in the system

* vesting scheduling working in polimec-receiver

* save: starting to implement transact response, but we need to store a new map of query id -> unconfirmed transactions

* save

* Migration for a single user working fully and tested

* Everything works!

* pallet_funding test broken currently

* bug found in evaluation unbonding by cleaner. Still an infinite loop bug remaining

* all bugs squashed B)

* need to find a way to generate function from a new macro

* need to find a way to generate function from a new macro

* e2e tests successfully adapted to the xcm emulator

* Testnet now using Oracle, and e2e successfully passing.

* not all xcmp messages being received

* save

* cleanup

* fmt

* fixes

* save

* limiting 5 migrations per block works

* fmt

* save

* back to normal migration without bundling per block, now works for some reason

* final commit

* first commit

* ct migration tests refactor

* stable

* using generate_accounts! macro in all integration tests

* wip

* big refactor

* almost there

* working

* final changes

* tests passing

* multiple projects test passing.
Big bug found with ever-increasing running times
Failing test for release of ct deposit on failed project

* state machine intergration for releasing deposit

* starting to fix last tests

* only evaluation automatic release working.
`bids_and_community_and_remainder_contribution_plmc_bonded_is_returned_automatically_on_funding_fail` failing because of this

* state machine fixed where it only worked on evaluations

* broken tests

* save

* manual and automatic ct mint tests now passing. Removed the specific ones for just bids/evals/contr. and merged them all into 1 for manual and one for automatic

* fixed most tests. Bid calculation function not working as intended now

* benchmark tests passing

* fmt. real benchmarks run successfully

* save

* fixes

* remove unnecessary time advancement in project creation

* MVP!

* multiple community projects can be parallelized

* all async creation functions working

* bid refund test not passing

* fixed

* projects meeting together at the desired state (they start at different points automatically)

* save

* fixed tests. they were failing due to debug durations not disabled

* traits broken :(

* save

* conditionally adding genesis config

* Fixed the externalities issue by using the single threaded tokio runtime. added check for asking more remainder CT buys that are available

* removed conditional instantiator fields and conditional genesis config on pallet-funding.

* fixes

* trying to remove Sync and Send traits

* trying to have one genesis config

* save

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* save

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* save

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* build-spec working but some logic in instantiator is failing bids

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* node instantiation confirmed to be working, and a test was written in integration-tests

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fix: fmt

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fix tests

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* merge fixes

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* new test

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove testing-node feature

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove cargo-expand-visible feature and unused modular genesis_config.rs

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove unused mut #130 (comment)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove unused mut #130 (comment)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* TODO added #130 (comment)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove unused old genesis builder #130 (comment)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove else statement #130 (comment)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove commented out lines #130 (comment)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove AccountList and use same pattern as other functions #130 (comment).

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* updated comment on Expendable reason
#130 (comment)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fix: could not compile pallet-funding alone due to missing `default = ["std"]"` in Cargo.toml

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* save

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fix linear-release benchmarks

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fix staking benchmarks and add optional compilation for externalities on instantiator

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* pallet_funding benchmarks fixed.

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* uncommented integration-tests. Had to do it to compile workspace with `runtime-benchmarks`

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* all benchmarks running to completion

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* save

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fix testnet runtime, bad merge with main

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fix import

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fixed staking benchmarks

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* cleanup

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* uncomment integration-tests

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove pallet_funding dependency from linear-release

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

---------

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>
vstam1 added a commit that referenced this pull request Jan 30, 2024
move to holds and freezes for election pallet

fix test

add pallets to base

add democracy pallet

set correct Governance config items

remove migrations

add test + default fast-gov

change fast-gov to fast-mode

add instant-mode

add gov tests

fmt

license changes + readme mentions

updated config items

Feat/enable staking (#143)

* chore: add the bootnodes to the production chain-spec

* chore: bump the CLI version

* feat: update Dockerfile

* feat: enable staking and disable normal vesting

* Update Dockerfile to copy polimec-raw-chain-spec.json to /data directory

Feature/plmc 350 setup offchain worker for price injection with first usdxusd (#118)

* basic setup for kraken fetcher

* add crypto to offchain worker

* add membership

* check for membership

* add multiple sources

* add full flow + first test

* add coinbase source

* address feedback + fix warnings

* fmt

* add ocw pallet to base runtime

* remove oracle from base

* add ocw pallet to test runtime

* wip

* wip

* chore: Update dependencies in Cargo.toml

* fix runtime

* node builds

* test in zombienet

* ignore bin

* fmt

* update calculations

* add ocw to base runtime and fix try-runtime feature prop

* requested changes

* fmt

---------

Co-authored-by: Leonardo Razovic <4128940+lrazovic@users.noreply.github.com>

Feature/plmc 391 allow parallel instantiaton of projects (#130)

* feat(287): parachain information discovery and channel opening

automatic hrmp connection working

Genesis instantiator usage and first draft of HRMP connection

formatting

feature propagation

cleanup

new node functioning. genesis not yet sure if working

new node functioning. genesis not yet sure if working

somehow compiling and test passing

save

save

save

feat(287): para_id setting extrinsic implemented and tested

save

same log crate across workspace

same log crate across workspace

save

save

save

feat(287): changed tight couple of pallet_xcm by extracting sender trait

feat(287): first commit

feat(285): POC Hrmp automatic acceptance

* first commit

* save

* penpal local fork

* save

* save

* save

* HRMP establishment successfully mocked!

* pallet-funding tests fixed

* migration check working

* fixes

* add cargo lock

* dmp fix

* formatting

* small fixed

* fixes

* save

* compiling, unit converion to map

* revert staking changes

* saving now evaluation reward and move to u64 for migration

* save

* save

* migration is successfully sent and reflected in the system

* vesting scheduling working in polimec-receiver

* save: starting to implement transact response, but we need to store a new map of query id -> unconfirmed transactions

* save

* Migration for a single user working fully and tested

* Everything works!

* pallet_funding test broken currently

* bug found in evaluation unbonding by cleaner. Still an infinite loop bug remaining

* all bugs squashed B)

* need to find a way to generate function from a new macro

* need to find a way to generate function from a new macro

* e2e tests successfully adapted to the xcm emulator

* Testnet now using Oracle, and e2e successfully passing.

* not all xcmp messages being received

* save

* cleanup

* fmt

* fixes

* save

* limiting 5 migrations per block works

* fmt

* save

* back to normal migration without bundling per block, now works for some reason

* final commit

* first commit

* ct migration tests refactor

* stable

* using generate_accounts! macro in all integration tests

* wip

* big refactor

* almost there

* working

* final changes

* tests passing

* multiple projects test passing.
Big bug found with ever-increasing running times
Failing test for release of ct deposit on failed project

* state machine intergration for releasing deposit

* starting to fix last tests

* only evaluation automatic release working.
`bids_and_community_and_remainder_contribution_plmc_bonded_is_returned_automatically_on_funding_fail` failing because of this

* state machine fixed where it only worked on evaluations

* broken tests

* save

* manual and automatic ct mint tests now passing. Removed the specific ones for just bids/evals/contr. and merged them all into 1 for manual and one for automatic

* fixed most tests. Bid calculation function not working as intended now

* benchmark tests passing

* fmt. real benchmarks run successfully

* save

* fixes

* remove unnecessary time advancement in project creation

* MVP!

* multiple community projects can be parallelized

* all async creation functions working

* bid refund test not passing

* fixed

* projects meeting together at the desired state (they start at different points automatically)

* save

* fixed tests. they were failing due to debug durations not disabled

* traits broken :(

* save

* conditionally adding genesis config

* Fixed the externalities issue by using the single threaded tokio runtime. added check for asking more remainder CT buys that are available

* removed conditional instantiator fields and conditional genesis config on pallet-funding.

* fixes

* trying to remove Sync and Send traits

* trying to have one genesis config

* save

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* save

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* save

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* build-spec working but some logic in instantiator is failing bids

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* node instantiation confirmed to be working, and a test was written in integration-tests

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fix: fmt

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fix tests

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* merge fixes

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* new test

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove testing-node feature

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove cargo-expand-visible feature and unused modular genesis_config.rs

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove unused mut #130 (comment)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove unused mut #130 (comment)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* TODO added #130 (comment)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove unused old genesis builder #130 (comment)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove else statement #130 (comment)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove commented out lines #130 (comment)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove AccountList and use same pattern as other functions #130 (comment).

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* updated comment on Expendable reason
#130 (comment)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fix: could not compile pallet-funding alone due to missing `default = ["std"]"` in Cargo.toml

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fix testnet runtime, bad merge with main

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fix import

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* add unwrap() to advance_time

Co-authored-by: Leonardo Razovic <4128940+lrazovic@users.noreply.github.com>

* fix imports from Leo's PR comment #130 (comment)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

---------

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>
Co-authored-by: Leonardo Razovic <4128940+lrazovic@users.noreply.github.com>

Feature/plmc 413 fix existing benchmarks (#146)

* feat(287): parachain information discovery and channel opening

automatic hrmp connection working

Genesis instantiator usage and first draft of HRMP connection

formatting

feature propagation

cleanup

new node functioning. genesis not yet sure if working

new node functioning. genesis not yet sure if working

somehow compiling and test passing

save

save

save

feat(287): para_id setting extrinsic implemented and tested

save

same log crate across workspace

same log crate across workspace

save

save

save

feat(287): changed tight couple of pallet_xcm by extracting sender trait

feat(287): first commit

feat(285): POC Hrmp automatic acceptance

* first commit

* save

* penpal local fork

* save

* save

* save

* HRMP establishment successfully mocked!

* pallet-funding tests fixed

* migration check working

* fixes

* add cargo lock

* dmp fix

* formatting

* small fixed

* fixes

* save

* compiling, unit converion to map

* revert staking changes

* saving now evaluation reward and move to u64 for migration

* save

* save

* migration is successfully sent and reflected in the system

* vesting scheduling working in polimec-receiver

* save: starting to implement transact response, but we need to store a new map of query id -> unconfirmed transactions

* save

* Migration for a single user working fully and tested

* Everything works!

* pallet_funding test broken currently

* bug found in evaluation unbonding by cleaner. Still an infinite loop bug remaining

* all bugs squashed B)

* need to find a way to generate function from a new macro

* need to find a way to generate function from a new macro

* e2e tests successfully adapted to the xcm emulator

* Testnet now using Oracle, and e2e successfully passing.

* not all xcmp messages being received

* save

* cleanup

* fmt

* fixes

* save

* limiting 5 migrations per block works

* fmt

* save

* back to normal migration without bundling per block, now works for some reason

* final commit

* first commit

* ct migration tests refactor

* stable

* using generate_accounts! macro in all integration tests

* wip

* big refactor

* almost there

* working

* final changes

* tests passing

* multiple projects test passing.
Big bug found with ever-increasing running times
Failing test for release of ct deposit on failed project

* state machine intergration for releasing deposit

* starting to fix last tests

* only evaluation automatic release working.
`bids_and_community_and_remainder_contribution_plmc_bonded_is_returned_automatically_on_funding_fail` failing because of this

* state machine fixed where it only worked on evaluations

* broken tests

* save

* manual and automatic ct mint tests now passing. Removed the specific ones for just bids/evals/contr. and merged them all into 1 for manual and one for automatic

* fixed most tests. Bid calculation function not working as intended now

* benchmark tests passing

* fmt. real benchmarks run successfully

* save

* fixes

* remove unnecessary time advancement in project creation

* MVP!

* multiple community projects can be parallelized

* all async creation functions working

* bid refund test not passing

* fixed

* projects meeting together at the desired state (they start at different points automatically)

* save

* fixed tests. they were failing due to debug durations not disabled

* traits broken :(

* save

* conditionally adding genesis config

* Fixed the externalities issue by using the single threaded tokio runtime. added check for asking more remainder CT buys that are available

* removed conditional instantiator fields and conditional genesis config on pallet-funding.

* fixes

* trying to remove Sync and Send traits

* trying to have one genesis config

* save

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* save

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* save

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* build-spec working but some logic in instantiator is failing bids

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* node instantiation confirmed to be working, and a test was written in integration-tests

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fix: fmt

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fix tests

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* merge fixes

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* new test

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove testing-node feature

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove cargo-expand-visible feature and unused modular genesis_config.rs

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove unused mut #130 (comment)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove unused mut #130 (comment)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* TODO added #130 (comment)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove unused old genesis builder #130 (comment)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove else statement #130 (comment)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove commented out lines #130 (comment)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove AccountList and use same pattern as other functions #130 (comment).

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* updated comment on Expendable reason
#130 (comment)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fix: could not compile pallet-funding alone due to missing `default = ["std"]"` in Cargo.toml

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* save

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fix linear-release benchmarks

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fix staking benchmarks and add optional compilation for externalities on instantiator

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* pallet_funding benchmarks fixed.

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* uncommented integration-tests. Had to do it to compile workspace with `runtime-benchmarks`

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* all benchmarks running to completion

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* save

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fix testnet runtime, bad merge with main

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fix import

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fixed staking benchmarks

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* cleanup

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* uncomment integration-tests

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove pallet_funding dependency from linear-release

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

---------

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

Add custom migrations for OracleProvidersMembership (#147)

* Add custom migrations for OracleProvidersMembership

* fix: fat fingers

* chore: bump version

* fix: workspace compilation was failing due to using conditional compilation inside `parameter_types!`

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

---------

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>
Co-authored-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

Feature/plmc 417 Update docs (#150)

* chore: align license headers

* docs: update README

* chore: update headers

* chore: align toml files

* chore: fix more header

Chore/optimize size (#151)

* chore: strip debuginfo

* chore: disable logging when we build the production runtime

* chore: zepter format the tomls

set block number back to 0 at the end of pallet_funding genesis (#153)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

chore: add helikon bootnodes (#152)

fix integration tests

add locking period to elections phragmen

add default members cargo config and fix benchmark tests

add test + remove try-runtime + benchmarks from integration tests
JuaniRios added a commit that referenced this pull request Feb 9, 2024
)

* feat(287): parachain information discovery and channel opening

automatic hrmp connection working

Genesis instantiator usage and first draft of HRMP connection

formatting

feature propagation

cleanup

new node functioning. genesis not yet sure if working

new node functioning. genesis not yet sure if working

somehow compiling and test passing

save

save

save

feat(287): para_id setting extrinsic implemented and tested

save

same log crate across workspace

same log crate across workspace

save

save

save

feat(287): changed tight couple of pallet_xcm by extracting sender trait

feat(287): first commit

feat(285): POC Hrmp automatic acceptance

* first commit

* save

* penpal local fork

* save

* save

* save

* HRMP establishment successfully mocked!

* pallet-funding tests fixed

* migration check working

* fixes

* add cargo lock

* dmp fix

* formatting

* small fixed

* fixes

* save

* compiling, unit converion to map

* revert staking changes

* saving now evaluation reward and move to u64 for migration

* save

* save

* migration is successfully sent and reflected in the system

* vesting scheduling working in polimec-receiver

* save: starting to implement transact response, but we need to store a new map of query id -> unconfirmed transactions

* save

* Migration for a single user working fully and tested

* Everything works!

* pallet_funding test broken currently

* bug found in evaluation unbonding by cleaner. Still an infinite loop bug remaining

* all bugs squashed B)

* need to find a way to generate function from a new macro

* need to find a way to generate function from a new macro

* e2e tests successfully adapted to the xcm emulator

* Testnet now using Oracle, and e2e successfully passing.

* not all xcmp messages being received

* save

* cleanup

* fmt

* fixes

* save

* limiting 5 migrations per block works

* fmt

* save

* back to normal migration without bundling per block, now works for some reason

* final commit

* first commit

* ct migration tests refactor

* stable

* using generate_accounts! macro in all integration tests

* wip

* big refactor

* almost there

* working

* final changes

* tests passing

* multiple projects test passing.
Big bug found with ever-increasing running times
Failing test for release of ct deposit on failed project

* state machine intergration for releasing deposit

* starting to fix last tests

* only evaluation automatic release working.
`bids_and_community_and_remainder_contribution_plmc_bonded_is_returned_automatically_on_funding_fail` failing because of this

* state machine fixed where it only worked on evaluations

* broken tests

* save

* manual and automatic ct mint tests now passing. Removed the specific ones for just bids/evals/contr. and merged them all into 1 for manual and one for automatic

* fixed most tests. Bid calculation function not working as intended now

* benchmark tests passing

* fmt. real benchmarks run successfully

* save

* fixes

* remove unnecessary time advancement in project creation

* MVP!

* multiple community projects can be parallelized

* all async creation functions working

* bid refund test not passing

* fixed

* projects meeting together at the desired state (they start at different points automatically)

* save

* fixed tests. they were failing due to debug durations not disabled

* traits broken :(

* save

* conditionally adding genesis config

* Fixed the externalities issue by using the single threaded tokio runtime. added check for asking more remainder CT buys that are available

* removed conditional instantiator fields and conditional genesis config on pallet-funding.

* fixes

* trying to remove Sync and Send traits

* trying to have one genesis config

* save

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* save

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* save

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* build-spec working but some logic in instantiator is failing bids

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* node instantiation confirmed to be working, and a test was written in integration-tests

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fix: fmt

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fix tests

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* merge fixes

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* new test

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove testing-node feature

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove cargo-expand-visible feature and unused modular genesis_config.rs

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove unused mut #130 (comment)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove unused mut #130 (comment)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* TODO added #130 (comment)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove unused old genesis builder #130 (comment)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove else statement #130 (comment)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove commented out lines #130 (comment)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove AccountList and use same pattern as other functions #130 (comment).

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* updated comment on Expendable reason
#130 (comment)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fix: could not compile pallet-funding alone due to missing `default = ["std"]"` in Cargo.toml

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* save

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fix linear-release benchmarks

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fix staking benchmarks and add optional compilation for externalities on instantiator

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* pallet_funding benchmarks fixed.

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* uncommented integration-tests. Had to do it to compile workspace with `runtime-benchmarks`

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* all benchmarks running to completion

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* save

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fix testnet runtime, bad merge with main

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fix import

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fixed staking benchmarks

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* cleanup

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* uncomment integration-tests

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove pallet_funding dependency from linear-release

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* write single test for each benchmark

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* successfully added the async parallel instantiaton in a real benchmark :)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* save

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* save

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* rename start_evaluation fn

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove unnecessary parameters from `create` and `edit_metadata`

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fix testnet pallet config

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* changed add_to_update_store

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* check tests pass, add new draft tests

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* add_to_update_store benchmark in start_evaluation

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* new pr template

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* only one pr template

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* new ProjectToUpdate functions that return parameters for weight functions.
Benchmark functions broken

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fixed eval start bench

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fix manual auction benchmark

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* english_start benchmarked

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* trying to remove `z` and add automatic auction bench

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* finished automatic auction benchmark, now running it for real

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* new weight gen

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* evaluation benchmarks. fix auction round extrinsic

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* save contributions extrinsic

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* contribution logic split into separate functions

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* all contribution bench branches coded. Missing single tests and using those weights in the contribute extrinsic

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* contribute benches tested and passing. Missing real benchmarking and adding the correct weights on the extrinsic

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* contribution_over_limit_ends_round removed since that case never happens

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* abstracted away `ProjectsToUpdate` filling

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* weight gen v2

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* added weight returns on contribute()

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* all tests for benches rewritten so far are passing

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* added ct_deposit difference benchmarks for first contribution. Bench running atm. Onward to bids

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* weight generated. Seems off

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* rename benches

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* modify contribution function to return new bench fns

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* removed chance to bid over the limit by removing the lowest bid.

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* bid benchmark abstracted for future complexity parametrization

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* complexity parameter `x` working (existing bids). Missing `y` for times "perform_bid" is called

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* new parameter "y" for amount of perform_bid calls on one extrinsic

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove unused bucket helper function

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* ct deposit bid benchmark difference

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* real weight returns added for bid extrinsic. Trying to update now price calculation test

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* updated test, but still inaccurate. 11.1818 vs 11

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* evaluation_unbond_for does not need complexity parameters

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* bug fixed in instantiator where multiple evaluations by same account didnt get the correct assertion. Bench written for reward to evaluators. Two branches: ct account created, and not

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* real weight returns on evaluation reward payouts

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* default weight on fn

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* evaluation slash does not need complexity parameters or logic branches

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* test for bench now passing. had to modify the state machine, but we will revise that code later

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* bid_ct_mint_for done

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* contribution_ct_mint_for done

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* contribution_ct_mint_for done

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* vesting schedule benchmarks (minimal changes)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* payouts benchmarks (minimal changes)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* all benchmarks passing

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* price test was correct, fixed the expectation

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* save

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fix evaluator rewards test

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fmt, remove draft tests

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove unused tests. Add real weights on pallet-funding

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* delete commented out code

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* weight returns testing possible :)
`start_evaluation` test done

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* removed benchmark tests. we think they are not necessary

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* add constant annotations to Config types
#148 (comment)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* rename benchmark variables to weight return variables

#148 (comment)
Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* is_empty()

Co-authored-by: Leonardo Razovic <4128940+lrazovic@users.noreply.github.com>

* is_zero()

Co-authored-by: Leonardo Razovic <4128940+lrazovic@users.noreply.github.com>

* fix post merge

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* push lock

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fix syntax

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fmt

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fmt

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

---------

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>
Co-authored-by: Leonardo Razovic <4128940+lrazovic@users.noreply.github.com>
JuaniRios added a commit that referenced this pull request Feb 15, 2024
…existing (#163)

* feat(287): parachain information discovery and channel opening

automatic hrmp connection working

Genesis instantiator usage and first draft of HRMP connection

formatting

feature propagation

cleanup

new node functioning. genesis not yet sure if working

new node functioning. genesis not yet sure if working

somehow compiling and test passing

save

save

save

feat(287): para_id setting extrinsic implemented and tested

save

same log crate across workspace

same log crate across workspace

save

save

save

feat(287): changed tight couple of pallet_xcm by extracting sender trait

feat(287): first commit

feat(285): POC Hrmp automatic acceptance

* first commit

* save

* penpal local fork

* save

* save

* save

* HRMP establishment successfully mocked!

* pallet-funding tests fixed

* migration check working

* fixes

* add cargo lock

* dmp fix

* formatting

* small fixed

* fixes

* save

* compiling, unit converion to map

* revert staking changes

* saving now evaluation reward and move to u64 for migration

* save

* save

* migration is successfully sent and reflected in the system

* vesting scheduling working in polimec-receiver

* save: starting to implement transact response, but we need to store a new map of query id -> unconfirmed transactions

* save

* Migration for a single user working fully and tested

* Everything works!

* pallet_funding test broken currently

* bug found in evaluation unbonding by cleaner. Still an infinite loop bug remaining

* all bugs squashed B)

* need to find a way to generate function from a new macro

* need to find a way to generate function from a new macro

* e2e tests successfully adapted to the xcm emulator

* Testnet now using Oracle, and e2e successfully passing.

* not all xcmp messages being received

* save

* cleanup

* fmt

* fixes

* save

* limiting 5 migrations per block works

* fmt

* save

* back to normal migration without bundling per block, now works for some reason

* final commit

* first commit

* ct migration tests refactor

* stable

* using generate_accounts! macro in all integration tests

* wip

* big refactor

* almost there

* working

* final changes

* tests passing

* multiple projects test passing.
Big bug found with ever-increasing running times
Failing test for release of ct deposit on failed project

* state machine intergration for releasing deposit

* starting to fix last tests

* only evaluation automatic release working.
`bids_and_community_and_remainder_contribution_plmc_bonded_is_returned_automatically_on_funding_fail` failing because of this

* state machine fixed where it only worked on evaluations

* broken tests

* save

* manual and automatic ct mint tests now passing. Removed the specific ones for just bids/evals/contr. and merged them all into 1 for manual and one for automatic

* fixed most tests. Bid calculation function not working as intended now

* benchmark tests passing

* fmt. real benchmarks run successfully

* save

* fixes

* remove unnecessary time advancement in project creation

* MVP!

* multiple community projects can be parallelized

* all async creation functions working

* bid refund test not passing

* fixed

* projects meeting together at the desired state (they start at different points automatically)

* save

* fixed tests. they were failing due to debug durations not disabled

* traits broken :(

* save

* conditionally adding genesis config

* Fixed the externalities issue by using the single threaded tokio runtime. added check for asking more remainder CT buys that are available

* removed conditional instantiator fields and conditional genesis config on pallet-funding.

* fixes

* trying to remove Sync and Send traits

* trying to have one genesis config

* save

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* save

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* save

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* build-spec working but some logic in instantiator is failing bids

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* node instantiation confirmed to be working, and a test was written in integration-tests

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fix: fmt

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fix tests

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* merge fixes

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* new test

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove testing-node feature

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove cargo-expand-visible feature and unused modular genesis_config.rs

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove unused mut #130 (comment)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove unused mut #130 (comment)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* TODO added #130 (comment)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove unused old genesis builder #130 (comment)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove else statement #130 (comment)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove commented out lines #130 (comment)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove AccountList and use same pattern as other functions #130 (comment).

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* updated comment on Expendable reason
#130 (comment)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fix: could not compile pallet-funding alone due to missing `default = ["std"]"` in Cargo.toml

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* save

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fix linear-release benchmarks

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fix staking benchmarks and add optional compilation for externalities on instantiator

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* pallet_funding benchmarks fixed.

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* uncommented integration-tests. Had to do it to compile workspace with `runtime-benchmarks`

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* all benchmarks running to completion

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* save

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fix testnet runtime, bad merge with main

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fix import

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fixed staking benchmarks

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* cleanup

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* uncomment integration-tests

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove pallet_funding dependency from linear-release

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* write single test for each benchmark

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* successfully added the async parallel instantiaton in a real benchmark :)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* save

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* save

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* rename start_evaluation fn

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove unnecessary parameters from `create` and `edit_metadata`

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fix testnet pallet config

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* changed add_to_update_store

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* check tests pass, add new draft tests

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* add_to_update_store benchmark in start_evaluation

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* new pr template

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* only one pr template

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* new ProjectToUpdate functions that return parameters for weight functions.
Benchmark functions broken

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fixed eval start bench

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fix manual auction benchmark

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* english_start benchmarked

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* trying to remove `z` and add automatic auction bench

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* finished automatic auction benchmark, now running it for real

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* new weight gen

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* evaluation benchmarks. fix auction round extrinsic

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* save contributions extrinsic

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* contribution logic split into separate functions

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* all contribution bench branches coded. Missing single tests and using those weights in the contribute extrinsic

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* contribute benches tested and passing. Missing real benchmarking and adding the correct weights on the extrinsic

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* contribution_over_limit_ends_round removed since that case never happens

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* abstracted away `ProjectsToUpdate` filling

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* weight gen v2

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* added weight returns on contribute()

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* all tests for benches rewritten so far are passing

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* added ct_deposit difference benchmarks for first contribution. Bench running atm. Onward to bids

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* weight generated. Seems off

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* rename benches

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* modify contribution function to return new bench fns

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* removed chance to bid over the limit by removing the lowest bid.

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* bid benchmark abstracted for future complexity parametrization

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* complexity parameter `x` working (existing bids). Missing `y` for times "perform_bid" is called

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* new parameter "y" for amount of perform_bid calls on one extrinsic

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove unused bucket helper function

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* ct deposit bid benchmark difference

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* real weight returns added for bid extrinsic. Trying to update now price calculation test

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* updated test, but still inaccurate. 11.1818 vs 11

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* evaluation_unbond_for does not need complexity parameters

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* bug fixed in instantiator where multiple evaluations by same account didnt get the correct assertion. Bench written for reward to evaluators. Two branches: ct account created, and not

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* real weight returns on evaluation reward payouts

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* default weight on fn

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* evaluation slash does not need complexity parameters or logic branches

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* test for bench now passing. had to modify the state machine, but we will revise that code later

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* bid_ct_mint_for done

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* contribution_ct_mint_for done

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* contribution_ct_mint_for done

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* vesting schedule benchmarks (minimal changes)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* payouts benchmarks (minimal changes)

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* all benchmarks passing

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* price test was correct, fixed the expectation

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* save

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fix evaluator rewards test

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fmt, remove draft tests

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove unused tests. Add real weights on pallet-funding

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* delete commented out code

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* weight returns testing possible :)
`start_evaluation` test done

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* removed benchmark tests. we think they are not necessary

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* evaluation end both logic paths written

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* unused var

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* weight generated look ok

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* candle phase done

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* trying to make community

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* remove refund bid on bad math. we now use saturating_mul_int

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* trying to add complexity params to community round transition

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* weird allocation bug when running new params bench

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* benchmark taking forever when adding 50k bids. Maybe I should replace the storage directly..

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* weight generated for new community funding success

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* added generated weight to pallet weight file

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* weight generated on remainder

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* project decision weights generated

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* end_funding benches written. Missing complexity parameters

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* complexity params for funding end written. Advancing blocks taking forever when having lots of evaluations. trying to find out why

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* save trying to debug time increase

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* all benches passing and BLAZING FAST 😎

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* comment out debug lines

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* debug weight generated for end_funding benchmarks
.max() added for worst case charging on weight annotation in extrinsics

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* BUGFIX: we now charge the issuer on project creation for the CT metadata storage.

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fix warnings

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fix tests

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fix benchmark

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* final weights generated

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* replace weights.rs file

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fmt

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* nightly fmt

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* update lock

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* assethub naming

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fixes

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* PLMC 432 Squash

new cargo lock

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

all tests passing

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

fmt

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

changed how we get the transition blocks in the async fns

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

add back full instantiation genesis config in testnet

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

bids in auction async instantiation working

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

bids in auction async instantiation working

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fixes post rebase

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* add back setting block to 0

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* small nits

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* unremoved todo

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* abstracted away execution of transition block on benchmarks as per Leo's suggestion

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

---------

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>
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.

None yet

4 participants