Skip to content

feat(frontend): integrate pow into loader and guard logic #5890

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

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

Conversation

DecentAgeCoder
Copy link
Collaborator

@DecentAgeCoder DecentAgeCoder commented Apr 16, 2025

Motivation

This Pull Request introduces a conditional feature toggle (POW_FEATURE_ENABLED) to support or bypass Proof-of-Work-related functionality. Modifications are made to reflect this toggle in address validation, component hierarchy, and loading logic.

Changes

  • AddressGuard.svelte:
    Introduced POW_FEATURE_ENABLED usage to conditionally skip initSignerAllowance logic.
  • Loaders.svelte:
    Updated component hierarchy to include a new wrapper component, PowProtector, for Proof-of-Work protection.
  • loader.services.ts:
    Incorporated POW_FEATURE_ENABLED to bypass conditional logic for invoking initSignerAllowance in the loading process.

Tests

DecentAgeCoder and others added 6 commits April 16, 2025 09:13
Copy link
Collaborator

@AntonioVentilii AntonioVentilii left a comment

Choose a reason for hiding this comment

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

Before anything, may you please provide an explanation in the description on why it will be ok that the component AddressGuard is agnostic to being allowed to sign? Like we discussed offline.

Most important part is: we are removing the check for the signer-allowance-success. Why?

@@ -18,11 +19,13 @@
let signerAllowanceLoaded = false;
const loadSignerAllowanceAndValidateAddresses = async () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe now can be renamed?

Copy link
Collaborator Author

@DecentAgeCoder DecentAgeCoder Apr 30, 2025

Choose a reason for hiding this comment

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

Yes the pow environment naming has been fixed

Copy link
Collaborator

Choose a reason for hiding this comment

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

i mean, if you are going to remove the signer allowance, you can rename this function no?

My understanding is that once the feature is complete, the feature flag is gone, so that part inside the IF condition disappear. Or not?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I recommend to leave the Feature flag, so that we can disable it quickly if there are issues with the PoW in production (e.g. to much CPU overhead, or not enough Cycles per time period are allowance (fine-tuning of settings)).

@DecentAgeCoder DecentAgeCoder marked this pull request as ready for review April 30, 2025 12:10
@DecentAgeCoder DecentAgeCoder requested a review from a team as a code owner April 30, 2025 12:10
@DecentAgeCoder DecentAgeCoder marked this pull request as draft April 30, 2025 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants