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

benchmarks for pallets #27

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Conversation

tlacloc
Copy link
Contributor

@tlacloc tlacloc commented Dec 13, 2023

  • Added pallet-example-basic to the workspace members and dependencies list
  • Updated the hashed-pallets repository
  • Replaced pallet-template with pallet-example-basic in the workspace members
  • Updated the version, authors, homepage, edition, license, repository and readme fields in all pallet Cargo.toml files
  • Added Unlicense license to README.md
  • Added a new package pallet-example-basic
  • Updated dependencies to v1.3.0-rc1
  • Added frame-benchmarking, frame-support, frame-system, pallet-balances, sp-io, sp-runtime, sp-std and sp-core dependencies
  • Added std and runtime-benchmarks features
  • Added try-runtime feature
  • Changed the casing of OfferStatus
  • Updated StorageVersion to 0
  • Removed imports from pallets/gated-marketplace/src/mock.rs
  • Added benchmarking for pallet-example-basic
  • Added tests for pallet-example-basic
  • Added weight functions for pallet-example-basic

…plate

🔥 refactor(lib.rs): Remove migrations module and v2 migration file
The benchmarking setup for the pallet-template has been updated to use the `frame_benchmarking::v2` module instead of `frame_benchmarking::{benchmarks, whitelisted_caller}`. This change improves compatibility with the latest version of the frame_benchmarking crate.

The migrations module and v2 migration file have been removed as they are no longer needed. The v2 migration logic has been integrated into the main pallet module, eliminating the need for a separate migrations module. This simplifies the codebase and improves maintainability.
…mplate'

The workspace members in the Cargo.toml file have been reorganized to improve readability and maintain consistency. The 'pallets/template' has been added as a new member to the workspace.
… pallet

🔀 chore(Cargo.toml): update workspace package information and add new pallet

The `[workspace.package]` section in `Cargo.toml` has been updated to include the authors, edition, and repository information for the project. Additionally, a new pallet named `example-basic` has been added to the list of members in the `[workspace]` section. These changes improve the project's metadata and include the new pallet in the workspace.
The commit removes unused code and files related to the `pallet-template` in the Substrate runtime. This cleanup improves code maintainability and reduces unnecessary clutter in the project.

🔥 refactor(mock.rs): remove unused mock file
🔥 refactor(tests.rs): remove unused test file
The mock.rs and tests.rs files are no longer needed and have been removed. These files were not being used and were cluttering the codebase. Removing them improves code organization and reduces unnecessary files.
The Cargo.toml file is added for the example-basic pallet. This file includes package metadata such as name, version, authors, license, and description. It also specifies dependencies and features required for the pallet. This addition is necessary for proper configuration and building of the example-basic pallet.
The README.md file is added to the example-basic pallet. It contains the license information, specifically stating that the license is Unlicense.
The Cargo.toml file has been updated to include the homepage and license information. The homepage is set to "https://hashed.io" and the license is specified as "MIT". This provides additional information and clarity about the project for users and contributors.
🔀 chore(pallets): update Cargo.toml files

The Cargo.toml files in the pallets directory have been updated to make the following changes:
- Set the authors, homepage, edition, license, and repository fields to be workspace-specific.
- Added a readme field pointing to the README.md file.

These changes were made to improve consistency and provide accurate information for the pallets in the project.
The Scale trait is no longer used in the codebase, so the import statement has been removed to improve code readability and reduce unnecessary dependencies.
The offer status variants in the `OfferStatus` enum have been changed to use proper capitalization. For example, `CREATED` is now `Created`, `TF_PENDING_SIGNATURE` is now `PendingTFSignature`, and so on. This improves consistency and readability of the code.

🐛 fix(mapped-assets): remove unused constant LOG_TARGET
The unused constant `LOG_TARGET` has been removed from the code. This improves code cleanliness and eliminates unnecessary clutter.
🔧 chore(tests.rs): remove unused Preservation variant
In the `mock.rs` file of the `afloat` pallet, the `UncheckedExtrinsic` type is no longer used, so it has been removed. This improves code readability and reduces unnecessary code.

In the `tests.rs` file of the `fund-admin` pallet, the `Preservation::Protect` variant is no longer used, so it has been removed. This simplifies the code and removes unnecessary options.

In the `mock.rs` file of the `gated-marketplace` pallet, unused imports and types (`RawOrigin`, `Lookup`, `AccountId`, `AccountId32`, `ApplyExtrinsicResult`, `MultiSignature`, `Percent`, `TransactionSource`, `TransactionValidity`, `BlockT`, `IdentifyAccount`, `Verify`, `NumberFor`, `AccountIdLookup`, `impl_opaque_keys`, `
@tlacloc tlacloc self-assigned this Dec 13, 2023
@@ -2145,6 +2145,23 @@ dependencies = [
"sp-runtime",

Choose a reason for hiding this comment

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

GPT summary of 4d949c - e53f7a:

  • Added a new package called "pallet-example-basic" with version "4.0.0-dev" and dependencies "frame-benchmarking", "frame-support", "frame-system", "log", "pallet-balances", "parity-scale-codec", "scale-info", "sp-core", "sp-io", "sp-runtime", and "sp-std"

@@ -1,14 +1,23 @@
[workspace.package]

Choose a reason for hiding this comment

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

GPT summary of c2a02c - 76c07f:

  • Added new [workspace.package] section with authors, edition, homepage, repository, and license fields.
  • Added 'pallets/example-basic' to the [workspace] members.
  • Added 'panic = 'unwind'' to the [profile.release] section.

@@ -1,13 +1,13 @@
[package]

Choose a reason for hiding this comment

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

GPT summary of a36bc6 - db42c4:

  • Updated version to 4.0.0-dev
  • Set authors, homepage, edition, license, repository, readme to workspace
  • Updated metadata docs.rs targets to x86_64-unknown-linux-gnu

@@ -969,22 +969,22 @@ impl<T: Config> Pallet<T> {
ensure!(is_admin_or_owner || offer.creator_id == who, Error::<T>::Unauthorized);

Choose a reason for hiding this comment

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

GPT summary of 6a0c05 - f30747:

  • Changed the casing of OfferStatus::CREATED to OfferStatus::Created
  • Changed the casing of OfferStatus::TF_PENDING_SIGNATURE to OfferStatus::PendingTFSignature
  • Added a cancellation_date field to both OfferStatus::Created and OfferStatus::PendingTFSignature
  • Changed the OfferStatus of both OfferStatus::Created and OfferStatus::PendingTFSignature to OfferStatus::Cancelled

@@ -15,12 +15,11 @@ pub mod types;
pub mod pallet {

Choose a reason for hiding this comment

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

GPT summary of 7bbf98 - 5e522f:

  • Removed Time trait from frame_support::traits
  • Added RawOrigin from frame_system
  • Removed Scale trait from sp_runtime::traits
  • Updated StorageVersion to StorageVersion::new(0)

@@ -9,7 +9,6 @@ use sp_runtime::{
traits::{BlakeTwo256, IdentityLookup},

Choose a reason for hiding this comment

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

GPT summary of b3edb9 - 0295d5:

  • Removed type alias for UncheckedExtrinsic
  • Added type alias for Block
  • Imported EnsureRoot and EnsureSigned from system module

@@ -72,21 +72,21 @@ pub enum SignUpArgs {
Encode, Decode, Clone, Eq, PartialEq, RuntimeDebugNoBound, MaxEncodedLen, TypeInfo, Copy,

Choose a reason for hiding this comment

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

GPT summary of 4b5dc0 - e8b575:

  • Renamed CREATED, MATCHED, TF_FILLED, TF_PENDING_SIGNATURE, TF_SIGNED, TF_SUBMITTED, TF_APPROVED, APPROVED, FILLED, CANCELLED to Created, Matched, FilledByTF, PendingTFSignature, SignedTF, SubmittedTF, ApprovedTF, Approved, Filled, Cancelled respectively.

@@ -1,13 +1,13 @@
[package]

Choose a reason for hiding this comment

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

GPT summary of ff18ca - f4345f:

  • Updated version from "4.0.0-dev" to "4.0.0-dev"
  • Added authors.workspace, homepage.workspace, edition.workspace, license.workspace, repository.workspace, and readme attributes
  • Updated targets from ["x86_64-unknown-linux-gnu"]

@@ -1,13 +1,13 @@
[package]

Choose a reason for hiding this comment

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

GPT summary of c0dc16 - c5e4d5:

  • Changed version, authors, homepage, edition, license, publish, and repository fields
  • Added authors.workspace, homepage.workspace, edition.workspace, license.workspace, repository.workspace, and readme fields
  • Updated docs.rs targets to include x86_64-unknown-linux-gnu

@@ -0,0 +1,59 @@
[package]

Choose a reason for hiding this comment

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

GPT summary of None - b5683a:

  • Added name, description, version, authors, homepage, edition, license, repository, and readme to [package] section
  • Added targets to [package.metadata.docs.rs] section
  • Added dependencies to [dependencies] section
  • Added dev-dependencies to [dev-dependencies] section
  • Added default, std, runtime-benchmarks, and try-runtime features to [features] section

@@ -0,0 +1,118 @@
// This file is part of Substrate.

Choose a reason for hiding this comment

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

GPT summary of None - 4b2ebb:

  • Added benchmarking for pallet-example-basic
  • Benchmarked the execution time of set_dummy and accumulate_dummy
  • Benchmarked the execution time of sorting a vector

@@ -0,0 +1,542 @@
// This file is part of Substrate.

Choose a reason for hiding this comment

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

GPT summary of None - 5eff74:
Error: couldn't generate summary

@@ -0,0 +1,198 @@
// This file is part of Substrate.

Choose a reason for hiding this comment

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

GPT summary of None - c7b5b9:

  • This git diff adds a test file for the pallet-example-basic pallet.
  • It includes tests for the optional value, default value, set_dummy, signed_ext_watch_dummy, counted_map, and weights functions.
  • It also includes the GenesisConfig and Config implementations for the Test runtime.

@@ -0,0 +1,95 @@
// This file is part of Substrate.

Choose a reason for hiding this comment

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

GPT summary of None - def944:

  • Added weight functions for pallet_example_basic
  • Added functions for setting dummy benchmark, accumulating dummy, and sorting vector
  • Added weights for pallet_example_basic using Substrate node and recommended hardware
  • Added weights for backwards compatibility and tests

@@ -1,13 +1,13 @@
[package]

Choose a reason for hiding this comment

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

GPT summary of 4a83df - 8b7768:

  • Updated version, authors, homepage, edition, license, repository, and readme fields in the [package] section of Cargo.toml
  • Added authors.workspace, homepage.workspace, edition.workspace, license.workspace, repository.workspace, and readme fields in the [package] section of Cargo.toml
  • Added targets field in the [package.metadata.docs.rs] section of Cargo.toml

@@ -1,13 +1,13 @@
[package]

Choose a reason for hiding this comment

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

GPT summary of d24e30 - f19c2e:

  • Updated package version from "4.0.0-dev" to "4.0.0-dev"
  • Added authors.workspace, homepage.workspace, edition.workspace, license.workspace, repository.workspace, and readme fields
  • Updated targets field to include "x86_64-unknown-linux-gnu"

@@ -1,13 +1,13 @@
[package]

Choose a reason for hiding this comment

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

GPT summary of 9fe0a4 - 416139:

  • Updated the version, authors, homepage, edition, license, publish, and repository fields in the [package] section of Cargo.toml
  • Added authors.workspace, homepage.workspace, edition.workspace, license.workspace, repository.workspace, and readme fields to the [package] section of Cargo.toml
  • Updated the targets field in the [package.metadata.docs.rs] section of Cargo.toml

@@ -10,7 +10,7 @@ use frame_support::{
traits::{

Choose a reason for hiding this comment

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

GPT summary of 402835 - eb96bf:

  • Changed Preserve and Protect in tokens::fungible::Mutate to Expendable.

@@ -1,13 +1,13 @@
[package]

Choose a reason for hiding this comment

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

GPT summary of 061dfb - b64f3b:

  • Changed version from 4.0.0-dev to 4.0.0-dev
  • Changed authors from Hashed <https://github.com/hashed-io to authors.workspace = true
  • Changed homepage from https://hashed.io to homepage.workspace = true
  • Changed edition from 2021 to edition.workspace = true
  • Changed license from MIT to license.workspace = true
  • Changed repository from https://github.com/hashed-io/hashed-pallets to repository.workspace = true
  • Added readme with value README.md

@@ -1,6 +1,4 @@
use crate as pallet_gated_marketplace;

Choose a reason for hiding this comment

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

GPT summary of 102714 - beb263:

  • Removed uses of RawOrigin and Lookup from the use statements
  • Changed Balance type from u64 to u128
  • Changed AccountId type from u64 to AccountId32
  • Removed uses of create_runtime_str, impl_opaque_keys, AccountIdLookup, BlockT, IdentifyAccount, NumberFor, Verify, ApplyExtrinsicResult, MultiSignature, and Percent from the use statements

Copy link

GPT summary of 5ad5847:

  • Moved the benchmarking setup to a separate feature benchmarking.rs
  • Moved the migrations code to a separate folder mod.rs, v2.rs
  • Updated the pallet storage version to 2 lib.rs
  • Migrated the storage of the pallet to a new prefix v2.rs

Copy link

GPT summary of 59f1b36:

  • Added pallet-template to the dependencies list Cargo.lock
  • Added pallet-template to the workspace members list Cargo.toml
  • Changed the panic setting for the release profile to unwind Cargo.toml

Copy link

GPT summary of 34553b8:

  • Added a new package pallet-example-basic Cargo.lock, Cargo.toml
  • Updated the hashed-pallets repository Cargo.toml
  • Replaced pallet-template with pallet-example-basic in the workspace members Cargo.toml

Copy link

GPT summary of 3386cd0:

Error: couldn't generate summary

Copy link

GPT summary of 300d85d:

  • Updated dependencies to v1.3.0-rc1 Cargo.toml
  • Added frame-benchmarking, frame-support, frame-system, pallet-balances, sp-io, sp-runtime, sp-std and sp-core dependencies Cargo.toml
  • Added std and runtime-benchmarks features Cargo.toml
  • Added try-runtime feature Cargo.toml

Copy link

GPT summary of 8223932:

  • Added Unlicense license to README.md README.md

Copy link

GPT summary of b15420a:

Error: couldn't generate summary

Copy link

GPT summary of e595f40:

  • Added homepage, repository and license fields to Cargo.toml Cargo.toml

Copy link

GPT summary of 0b44418:

Copy link

GPT summary of 05b376a:

  • Removed the Time trait from the frame_support import lib.rs
  • Removed the Scale trait from the sp_runtime import lib.rs
  • Updated the StorageVersion to 0 lib.rs

Copy link

GPT summary of ed1b78b:

  • Changed the OfferStatus enum from CREATED, MATCHED, TF_FILLED, TF_PENDING_SIGNATURE, TF_SIGNED, TF_SUBMITTED, TF_APPROVED, APPROVED, FILLED, CANCELLED to Created, Matched, FilledByTF, PendingTFSignature, SignedTF, SubmittedTF, ApprovedTF, Approved, Filled, Cancelled functions.rs, types.rs
  • Removed the LOG_TARGET constant from the AssetsCallback trait lib.rs

Copy link

GPT summary of 3522228:

  • Removed RawOrigin and Lookup imports from pallets/gated-marketplace/src/mock.rs
  • Updated Preservation imports in pallets/fund-admin/src/tests.rs
  • Removed AccountId type and AccountId32, MultiSignature, Percent, ApplyExtrinsicResult, Verify, NumberFor, IdentifyAccount, BlockT imports from pallets/gated-marketplace/src/mock.rs
  • Changed type of UncheckedExtrinsic from frame_system::mocking::MockUncheckedExtrinsic<Test> to sp_runtime::TransactionValidity in pallets/afloat/src/mock.rs

PR summary so far:

  • Added pallet-example-basic to the workspace members and dependencies list
  • Updated the hashed-pallets repository
  • Replaced pallet-template with pallet-example-basic in the workspace members
  • Updated the version, authors, homepage, edition, license, repository and readme fields in all pallet Cargo.toml files
  • Added Unlicense license to README.md
  • Added a new package pallet-example-basic
  • Updated dependencies to v1.3.0-rc1
  • Added frame-benchmarking, frame-support, frame-system, pallet-balances, sp-io, sp-runtime, sp-std and sp-core dependencies
  • Added std and runtime-benchmarks features
  • Added try-runtime feature
  • Changed the casing of OfferStatus
  • Updated StorageVersion to 0
  • Removed imports from pallets/gated-marketplace/src/mock.rs
  • Added benchmarking for pallet-example-basic
  • Added tests for pallet-example-basic
  • Added weight functions for pallet-example-basic

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.

1 participant