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

[Improve] CalculateNetworkFee #3481

Open
cschuchardt88 opened this issue Sep 7, 2024 · 0 comments
Open

[Improve] CalculateNetworkFee #3481

cschuchardt88 opened this issue Sep 7, 2024 · 0 comments
Labels
Discussion Initial issue state - proposed but not yet accepted

Comments

@cschuchardt88
Copy link
Member

cschuchardt88 commented Sep 7, 2024

Summary or problem description
The way that CalculateNetworkFee parameters are and using extension method is not the easy nor the best way of getting the networkFee. It requires WAY to much overhead. Same calculating for TransactionAttribute.CalculateNetworkFee.

        public static long CalculateNetworkFee(
            this Transaction tx,
            DataCache snapshot,
            ProtocolSettings settings,
            Func<UInt160, byte[]> accountScript,
            long maxExecutionCost = ApplicationEngine.TestModeGas);

Do you have any solution you want to propose?
Create different ambiguous methods for CalculateNetworkFee.

Recommended Methods:

// Throw exception when 'contract' is signer
public static long CalculateNetworkFee(this Transaction tx, long exec_fee_factor);
// Does what it does now
public static long CalculateNetworkFee(this Transaction tx, DataCache snapshot, ProtocolSettings settings);

Where in the software does this update applies to?

  • Core
@cschuchardt88 cschuchardt88 added the Discussion Initial issue state - proposed but not yet accepted label Sep 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion Initial issue state - proposed but not yet accepted
Projects
None yet
Development

No branches or pull requests

1 participant