Skip to content

feat: scale gasprice by 1e12#663

Merged
klkvr merged 12 commits intomainfrom
klkvr/scale-gas-price
Nov 4, 2025
Merged

feat: scale gasprice by 1e12#663
klkvr merged 12 commits intomainfrom
klkvr/scale-gas-price

Conversation

@klkvr
Copy link
Copy Markdown
Member

@klkvr klkvr commented Nov 4, 2025

Closes #629

changes all relevant code to calculate transaction cost as (gas * gas_price).div_ceil(1e12)

@klkvr klkvr requested a review from 0xKitsune November 4, 2025 15:30
Copy link
Copy Markdown
Contributor

@0xKitsune 0xKitsune left a comment

Choose a reason for hiding this comment

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

In general lgtm, just a few small comments. Would also just like to get a second set of eyes from @mattsee

Comment thread crates/primitives/src/transaction/mod.rs Outdated
"adagioTime": 0
},
"baseFeePerGas": "0x2c",
"baseFeePerGas": "0x28048c5ec000",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should adjust this to ensure transfers are < ~$0.0001.

@danrobinson to confirm this value.

Copy link
Copy Markdown
Contributor

@danrobinson danrobinson Nov 4, 2025

Choose a reason for hiding this comment

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

<$0.001 (tenth of a cent, not hundredth)! And should be slightly less

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

should we go with 0.04 wei per gas? would mean that min tx cost is 21000 * 0.04 = $0.00084

Copy link
Copy Markdown
Contributor

@danrobinson danrobinson Nov 4, 2025

Choose a reason for hiding this comment

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

What's the gas cost of a transaction that includes a TIP-20 token transfer, though?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

likely to change soon once we start charging for storage reads properly, with policy/paused checks might be closer to 50k

@klkvr klkvr force-pushed the klkvr/scale-gas-price branch from 543e3c8 to fcdf35d Compare November 4, 2025 16:46
Copy link
Copy Markdown
Contributor

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

lgtm, only have doc nits

use tempo_primitives::TempoHeader;

pub const TEMPO_BASE_FEE: u64 = 44;
pub const TEMPO_BASE_FEE: u64 = 44_000_000_000_000;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can we add the unit here and document and also add the hex value in docs (helps me find stuff)

this reduces mental load when reviewing this

@klkvr klkvr merged commit 79ebd31 into main Nov 4, 2025
11 of 15 checks passed
@klkvr klkvr deleted the klkvr/scale-gas-price branch November 4, 2025 21:35
unbalancedparentheses pushed a commit to unbalancedparentheses/tempo that referenced this pull request Feb 23, 2026
Closes tempoxyz#629 

changes all relevant code to calculate transaction cost as `(gas *
gas_price).div_ceil(1e12)`
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.

Support sub-cent transactions

4 participants