SeverityIssueProblemSolution
CriticalPrioritize reserve asset transfer over teleportUsing teleports from multiple origins as default token transfer method requires bilateral trust in issuance management and increases riskPrioritize Reserve Asset transfers and use trusted reserves like Asset Hub; carefully configure xcm-executor permissions
CriticalUse appropriate origin checksOpen access on extrinsics without checks may allow unauthorized actions that can compromise securityAdd access control checks to limit access to specific users or roles
CriticalAvoid unbounded iterationUnbounded iterations over large data structures can lead to resource exhaustion and potential denial of serviceImplement limits or use a bounded storage map for these iterations
CriticalUnchecked input dataLack of input validation can lead to unexpected behaviors and potential vulnerabilitiesValidate input data before processing to ensure safe and predictable behavior
CriticalAvoid unwrap usage inside runtimeUsing unwrap() or expect without proper error handling can lead to runtime panics and crashesHandle errors gracefully with Result or Option types to prevent panics
CriticalUse benchmarking for accurate dynamic weightsUsing hardcoded weights for extrinsics can lead to inaccurate resource estimations and performance issues.Implement benchmarking to dynamically assess the weights of functions, ensuring they accurately reflect execution costs
HighMake proper usage of XCM JunctionsMisuse of junction types (especially GeneralIndex) for purposes beyond their intended entity representation can lead to incorrect path routingUse junctions strictly for their intended purpose of representing entities in Location paths; propose RFCs for new needs
HighProperly setup XCM BarrierImproperly configured XCM executor barriers can allow unauthorized free execution from any originImplement restrictive barriers with explicit authorization for unpaid execution and clear documentation of intended uses
HighEnsure consistent asset registration by adhering to host chain schemaInconsistent asset registration schemas across chains can lead to integration issues and complications in cross-chain asset handlingStudy and follow the host chain's established schema for asset registration to maintain consistency
HighBenchmark Extrinsic Worst-case ScenarioWithout benchmarks for worst-case scenarios, execution weights may be underestimatedBenchmark worst-case paths and update extrinsics to reflect these cases accurately
HighKeep dependencies up to dateUsing outdated libraries may lead to security and compatibility issuesRegularly update dependencies to the latest stable versions for improved security and compatibility
HighAvoid the usage of pseudo random numbersUsing non-deterministic methods for selection can introduce manipulation opportunitiesAdopt deterministic selection methods to ensure fairness
HighUse safe arithmetic operationsUnchecked arithmetic operations can lead to overflow errorsUse safe math functions such as checked_add to prevent overflows
HighBe careful with storage growthAllowing unlimited entries in storage structures can lead to overflow and performance issuesUse bounded storage collections to prevent uncontrolled growth
HighPrevent inconsistent state by distributing finalization costsRelying on a single transaction to finalize multiple operations can lead to errors if it failsUse a claim-based or distributed finalization approach to avoid reliance on a single transaction
HighUse atomic operations to prevent state inconsistenciesModifying multiple resources without transactional integrity may leave the system in an inconsistent stateImplement rollback mechanisms to ensure consistency in case of failure
HighAvoid redundant storage access in mutationsUsing both try_mutate and insert leads to unnecessary storage accessesUse try_mutate or try_mutate_exists to read, modify, and write in a single step
HighPrevent unnecessary reads and writes in storage accessFrequent reads and writes to storage without optimization can degrade performanceUse efficient storage access methods such as try_mutate to combine reads and writes
HighImplement try-state HookThe absence of try-state hooks prevents runtime sanity checks, making it harder to ensure that the storage state is sensible after upgradesImplement the try-state hook to perform thorough state checks without altering storage
MediumImplement proper XCM fee managementUsing the FeeManager unit type without consideration leads to unintended fee burning rather than proper fee handlingImplement proper FeeManager that either deposits or distributes fees, with clear handling of fee-exempt locations
MediumAvoid unrestricted XCM ExecutionAllowing arbitrary users to send unrestricted XCM instructions, especially Transact operations, can create security vulnerabilitiesDisable or strictly limit XCM execution permissions unless specifically required; restrict to privileged users
MediumRemove deprecated storage gettersUsing deprecated storage getters may lead to compatibility issues in future versionsReplace deprecated getters with the recommended methods in updated frameworks
MediumAvoid hardcoded parameters and valuesHardcoding parameters can reduce flexibility and adaptability to different environmentsUse configurable parameters to enhance adaptability
MediumInclude tests for edge casesOmitting tests for boundary cases can lead to unhandled conditions and bugsInclude tests for boundary conditions to improve reliability
MediumInclude extrinsic documentationExtrinsics without documentation can lead to misunderstandings regarding usage permissions and error handlingProvide detailed documentation for each extrinsic, including functionality and parameters
MediumInclude error documentationLack of documentation on error variants can make debugging difficult and slowDocument each error variant with its cause and handling details for easier troubleshooting
MediumProvide event documentationEvents emitted by the runtime lack proper documentation, making it harder for users to understand their purposeProvide detailed comments for each event to explain its purpose and usage
MediumProvide pallet configuration documentationPallet configuration items that lack documentation can confuse developers and usersDocument each pallet configuration item with a brief description of its purpose and constraints
MediumModularize large filesLarge files reduce readability and make navigation difficult for developersProvide detailed comments for each event to explain its purpose and usage
MediumBreak down complex functionsComplex functions are harder to test, understand, and maintain, increasing the risk of errorsApply the single responsibility principle to simplify functions and improve readability
MediumEnhance performance with efficient data structuresChoosing inefficient data structures can lead to slowdowns and increased resource usageUse search-efficient data structures like HashSetor BTreeSet for frequent lookups
MediumDefine constants to replace magic numbersMagic numbers make code hard to understand and maintain due to lack of contextDefine constants with descriptive names for better readability
MediumImplement Proper Interface SegregationOverloaded interfaces make code harder to maintain and test due to complex dependenciesSeparate interfaces into smaller, focused traits to improve modularity
MediumMake BoundedVec size configurableHardcoded BoundedVec sizes limit flexibility and adaptabilityUse configurable parameters for vector sizes to enhance flexibility
MediumEnhance logging in migration scriptsInsufficient logging in migration scripts makes tracing progress and debugging harderAdd descriptive logs to migration scripts to track steps and conditions
MediumAvoid redundant data structuresStoring the same data in multiple locations increases complexity and risks inconsistenciesUse a single structure as the primary source for data, and avoid duplicating fields across storage structures
MediumImplement tests for all error casesLack of tests for error cases in extrinsics can lead to unhandled scenarios and unpredictable behaviorAdd tests that verify expected errors are emitted when invalid inputs or conditions are encountered
MediumAvoid resource intensive execution inside hooksPerforming complex or large computations in hooks like on_finalize can slow block execution and reduce network performanceDistribute computations across extrinsics or allow users to manually trigger them outside of hooks.
MediumTransition away from Currency traitUsing the deprecated Currency trait limits compatibility and functionality in future Substrate updatesReplace Currency with fungible traits, like Inspect and Mutate, for modular, future-proof balance management
LowUse appropriate naming conventionsInconsistent naming conventions reduce code readabilityAdopt consistent, descriptive naming conventions across the codebase
LowAvoid unnecessary cloningRedundant code and cloning increase code size and decrease efficiencyRemove unused code and optimize cloning operations
LowAvoid hardcoded error messagesHardcoded error messages make localization and updates difficultCentralize error messages for easier updates and localization
LowAdopt enumerations for optional inputUsing basic types instead of enums can lead to errors and reduces readabilityUse enums to represent distinct categories for better readability and robustness
LowImplement descriptive loggingMinimal logging lacks context, making troubleshooting difficultInclude context and relevant details in log messages
LowRemove unnecessary return valuesReturning values that are not modified or needed increases code complexityRemove unnecessary return values for simplicity
LowAvoid repetitive generic type instantiationDefining complex generic types repeatedly increases verbosity and reduces maintainabilityUse a type alias for specific instances of generic types to avoid duplication and enhance code readability
LowUpdate benchmarks with deprecated syntaxDeprecated benchmarking syntax can lead to compatibility issues and lacks support for newer featuresUse the updated #[benchmarks] module syntax to improve maintainability, readability, and future compatibility
LowExpose runtime APIs for key functionalitiesFailing to expose useful internal functions via runtime APIs limits client access and reduces system usabilityImplement Runtime APIs to expose key functions, enabling users and clients to access essential data
LowAvoid unused codeUnused code can clutter a codebase, making it more difficult to read, maintain, and optimize.Regularly remove unused functions, variables, and redundant logic to keep code clean and efficient
InformationalUse proper naming criteriaUsing commonly used terminology (like "foreign") can cause confusion and misunderstandings, especially when integrating with existing systemsResearch ecosystem terminology and choose unique, clear names that avoid overlap with existing well-known terms
InformationalMaintain consistent documentation standardsInconsistent documentation across modules creates knowledge gapsEstablish a consistent documentation standard across the codebase
InformationalAvoid typographical errorsTypos reduce professionalism and may confuse readersPerform proofreading to catch typos and improve clarity
InformationalMake backend logic Frontend-AgnosticFrontend-specific values in backend code may lead to conflicts with backend designEnsure backend remains frontend-agnostic to avoid inconsistencies