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

chore(wallet)_: include l1 fees info (for the tx and approval) in the response #6271

Merged
merged 3 commits into from
Jan 31, 2025

Conversation

saledjenic
Copy link
Contributor

A while ago we disabled l1 info cause the estimated L1 fees were significantly higher than they should have been (if I remember well, the L1 fees were about 1000 times higher than they should have been).

From this point, that wrong value might be coming from unreliable pokt calls/values, these changes bring them back.

@saledjenic
Copy link
Contributor Author

Initiative for this PR is coming from this comment status-im/status-mobile#21876 (comment)

@status-im-auto
Copy link
Member

status-im-auto commented Jan 20, 2025

Jenkins Builds

Click to see older builds (77)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 67b8da3 #1 2025-01-20 10:38:45 ~3 min ios 📦zip
✔️ 67b8da3 #1 2025-01-20 10:40:17 ~5 min linux 📦zip
✔️ 67b8da3 #1 2025-01-20 10:40:27 ~5 min macos 📦zip
✔️ 67b8da3 #1 2025-01-20 10:40:36 ~5 min android 📦aar
✔️ 67b8da3 #1 2025-01-20 10:40:45 ~5 min macos 📦zip
✖️ 67b8da3 #1 2025-01-20 10:40:49 ~5 min tests-rpc 📄log
✔️ 67b8da3 #1 2025-01-20 10:41:04 ~6 min windows 📦zip
✖️ 67b8da3 #1 2025-01-20 11:05:34 ~30 min tests 📄log
✔️ 214e425 #2 2025-01-23 18:27:23 ~5 min ios 📦zip
✔️ 214e425 #2 2025-01-23 18:59:37 ~6 min android 📦aar
✖️ 214e425 #2 2025-01-23 21:33:14 ~31 min tests 📄log
✖️ 214e425 #2 2025-01-23 23:20:05 ~5 min tests-rpc 📄log
✔️ 214e425 #2 2025-01-24 10:47:51 ~5 min linux 📦zip
✔️ 214e425 #2 2025-01-24 11:21:03 ~5 min macos 📦zip
✔️ 214e425 #2 2025-01-24 11:26:09 ~7 min macos 📦zip
✔️ 214e425 #2 2025-01-24 13:05:48 ~7 min windows 📦zip
✖️ 214e425 #3 2025-01-24 13:05:58 ~3 min tests-rpc 📄log
✖️ 214e425 #4 2025-01-24 13:23:57 ~3 min tests-rpc 📄log
✖️ 214e425 #3 2025-01-24 13:49:36 ~29 min tests 📄log
✔️ 39ed123 #3 2025-01-24 13:43:59 ~3 min macos 📦zip
✔️ 39ed123 #3 2025-01-24 13:44:15 ~4 min ios 📦zip
✔️ 39ed123 #3 2025-01-24 13:44:45 ~4 min windows 📦zip
✔️ 39ed123 #3 2025-01-24 13:45:30 ~5 min macos 📦zip
✔️ 39ed123 #3 2025-01-24 13:45:36 ~5 min linux 📦zip
✔️ 39ed123 #3 2025-01-24 13:45:43 ~5 min android 📦aar
✖️ 39ed123 #5 2025-01-24 13:45:52 ~5 min tests-rpc 📄log
✖️ 39ed123 #4 2025-01-24 14:20:19 ~30 min tests 📄log
✔️ 3a81b49 #4 2025-01-24 15:12:49 ~3 min ios 📦zip
✔️ 3a81b49 #4 2025-01-24 15:12:58 ~3 min macos 📦zip
✔️ 3a81b49 #4 2025-01-24 15:13:17 ~4 min windows 📦zip
✔️ 3a81b49 #4 2025-01-24 15:14:26 ~5 min macos 📦zip
✔️ 3a81b49 #4 2025-01-24 15:14:37 ~5 min linux 📦zip
✖️ 3a81b49 #6 2025-01-24 15:14:38 ~5 min tests-rpc 📄log
✔️ 3a81b49 #4 2025-01-24 15:14:47 ~5 min android 📦aar
✔️ 3a81b49 #5 2025-01-24 15:40:09 ~31 min tests 📄log
✔️ b554ae2 #5 2025-01-28 10:10:57 ~3 min ios 📦zip
✔️ b554ae2 #5 2025-01-28 10:11:40 ~4 min macos 📦zip
✔️ b554ae2 #5 2025-01-28 10:12:37 ~5 min macos 📦zip
✔️ b554ae2 #5 2025-01-28 10:12:43 ~5 min android 📦aar
✔️ b554ae2 #5 2025-01-28 10:12:44 ~5 min linux 📦zip
✔️ b554ae2 #5 2025-01-28 10:13:03 ~5 min windows 📦zip
✔️ b554ae2 #7 2025-01-28 10:14:00 ~6 min tests-rpc 📄log
✔️ b554ae2 #6 2025-01-28 10:37:27 ~30 min tests 📄log
✔️ f126502 #6 2025-01-28 23:47:24 ~3 min ios 📦zip
✔️ f126502 #6 2025-01-28 23:47:56 ~4 min macos 📦zip
✔️ f126502 #6 2025-01-28 23:48:05 ~4 min windows 📦zip
✔️ f126502 #6 2025-01-28 23:49:20 ~5 min linux 📦zip
✔️ f126502 #6 2025-01-28 23:49:27 ~5 min android 📦aar
✔️ f126502 #6 2025-01-28 23:49:29 ~5 min macos 📦zip
✖️ f126502 #8 2025-01-28 23:50:18 ~6 min tests-rpc 📄log
✖️ f126502 #7 2025-01-29 00:13:28 ~29 min tests 📄log
✔️ c9651fa #7 2025-01-29 09:49:41 ~3 min windows 📦zip
✔️ c9651fa #7 2025-01-29 09:50:31 ~4 min macos 📦zip
✔️ c9651fa #7 2025-01-29 09:50:40 ~4 min ios 📦zip
✔️ c9651fa #7 2025-01-29 09:51:23 ~5 min macos 📦zip
✔️ c9651fa #7 2025-01-29 09:51:32 ~5 min android 📦aar
✔️ c9651fa #7 2025-01-29 09:51:38 ~5 min linux 📦zip
✖️ c9651fa #9 2025-01-29 09:51:55 ~6 min tests-rpc 📄log
✖️ c9651fa #8 2025-01-29 10:15:48 ~29 min tests 📄log
✔️ 72ac3ad #8 2025-01-30 15:59:30 ~4 min ios 📦zip
✔️ 72ac3ad #8 2025-01-30 15:59:36 ~3 min windows 📦zip
✔️ 72ac3ad #8 2025-01-30 16:00:02 ~4 min macos 📦zip
✔️ 72ac3ad #8 2025-01-30 16:00:46 ~5 min macos 📦zip
✔️ 72ac3ad #8 2025-01-30 16:00:52 ~5 min linux 📦zip
✔️ 72ac3ad #8 2025-01-30 16:01:16 ~5 min android 📦aar
✖️ 72ac3ad #10 2025-01-30 16:01:42 ~6 min tests-rpc 📄log
✖️ 72ac3ad #9 2025-01-30 16:25:11 ~29 min tests 📄log
✔️ 6878af5 #9 2025-01-30 19:56:43 ~3 min ios 📦zip
✔️ 6878af5 #9 2025-01-30 19:56:51 ~3 min macos 📦zip
✔️ 6878af5 #9 2025-01-30 19:57:01 ~4 min windows 📦zip
✔️ 6878af5 #9 2025-01-30 19:58:24 ~5 min macos 📦zip
✔️ 6878af5 #9 2025-01-30 19:58:47 ~6 min android 📦aar
✔️ 6878af5 #11 2025-01-30 19:59:39 ~6 min tests-rpc 📄log
✔️ 6878af5 #9 2025-01-30 20:00:21 ~7 min linux 📦zip
✖️ 6878af5 #12 2025-01-30 20:18:34 ~4 min tests-rpc 📄log
✖️ 6878af5 #10 2025-01-30 20:22:07 ~29 min tests 📄log
✔️ 6878af5 #13 2025-01-30 20:40:42 ~4 min tests-rpc 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ e0ac920 #10 2025-01-30 22:02:51 ~3 min windows 📦zip
✔️ e0ac920 #10 2025-01-30 22:02:57 ~4 min macos 📦zip
✔️ e0ac920 #10 2025-01-30 22:03:28 ~4 min ios 📦zip
✔️ e0ac920 #10 2025-01-30 22:04:21 ~5 min linux 📦zip
✔️ e0ac920 #10 2025-01-30 22:04:40 ~5 min android 📦aar
✔️ e0ac920 #14 2025-01-30 22:04:58 ~6 min tests-rpc 📄log
✔️ e0ac920 #10 2025-01-30 22:05:26 ~6 min macos 📦zip
✔️ e0ac920 #11 2025-01-30 22:28:08 ~29 min tests 📄log
✔️ 9487843 #11 2025-01-31 16:44:19 ~3 min ios 📦zip
✔️ 9487843 #11 2025-01-31 16:44:26 ~3 min macos 📦zip
✔️ 9487843 #11 2025-01-31 16:44:26 ~3 min windows 📦zip
✔️ 9487843 #11 2025-01-31 16:45:45 ~5 min macos 📦zip
✔️ 9487843 #11 2025-01-31 16:46:01 ~5 min linux 📦zip
✔️ 9487843 #11 2025-01-31 16:46:16 ~5 min android 📦aar
✔️ 9487843 #15 2025-01-31 16:47:14 ~6 min tests-rpc 📄log
✔️ 9487843 #12 2025-01-31 17:10:12 ~29 min tests 📄log

Copy link
Collaborator

@alaibe alaibe left a comment

Choose a reason for hiding this comment

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

Have u confirmed the value makes sense?

@saledjenic
Copy link
Contributor Author

Have u confirmed the value makes sense?

I did not. Expect people from the mobile team to check and respond to that.

@pavloburykh
Copy link

@saledjenic thank you for the PR. Could you please check the ISSUE 1 identified in corresponding mobile PR?

@saledjenic saledjenic force-pushed the chore/include-l1-fees branch from 67b8da3 to 214e425 Compare January 23, 2025 14:28
@saledjenic
Copy link
Contributor Author

@pavloburykh could you try again now?

Copy link
Contributor

@dlipicar dlipicar left a comment

Choose a reason for hiding this comment

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

changes look good, waiting for confirmation that the values actually make sense

@pavloburykh
Copy link

@pavloburykh could you try again now?

thank you @saledjenic! @VolodLytvynenko will be able to pick it up tomorrow, as I will be off. Also, I see some builds failed in this PR, is it related to changes of some infra issues?

@saledjenic
Copy link
Contributor Author

is it related to changes of some infra issues?

Should not be up to the changes here, something must be stuck, will push again later and see.

Copy link

codecov bot commented Jan 24, 2025

Codecov Report

Attention: Patch coverage is 61.78344% with 60 lines in your changes missing coverage. Please review.

Project coverage is 61.84%. Comparing base (214cac9) to head (9487843).
Report is 4 commits behind head on develop.

Files with missing lines Patch % Lines
services/wallet/router/router_helper.go 58.33% 13 Missing and 2 partials ⚠️
services/wallet/router/fees/fees.go 75.00% 8 Missing and 1 partial ⚠️
services/wallet/router/fees/suggested_priority.go 81.08% 4 Missing and 3 partials ⚠️
services/wallet/router/router.go 57.14% 5 Missing and 1 partial ⚠️
services/wallet/router/routes/router_path.go 50.00% 2 Missing and 1 partial ⚠️
services/connector/commands/send_transaction.go 0.00% 2 Missing ⚠️
services/wallet/router/fees/fees_history.go 0.00% 2 Missing ⚠️
...let/router/pathprocessor/processor_bridge_celar.go 0.00% 1 Missing ⚠️
...allet/router/pathprocessor/processor_bridge_hop.go 75.00% 1 Missing ⚠️
...t/router/pathprocessor/processor_community_burn.go 0.00% 1 Missing ⚠️
... and 13 more
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #6271      +/-   ##
===========================================
+ Coverage    61.81%   61.84%   +0.03%     
===========================================
  Files          849      849              
  Lines       111429   111427       -2     
===========================================
+ Hits         68877    68914      +37     
+ Misses       34552    34516      -36     
+ Partials      8000     7997       -3     
Flag Coverage Δ
functional 21.63% <51.59%> (-0.01%) ⬇️
unit 60.33% <56.68%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...et/router/pathprocessor/processor_swap_paraswap.go 48.73% <100.00%> (+1.01%) ⬆️
.../wallet/router/pathprocessor/processor_transfer.go 60.00% <100.00%> (+2.42%) ⬆️
...let/router/pathprocessor/processor_bridge_celar.go 0.00% <0.00%> (ø)
...allet/router/pathprocessor/processor_bridge_hop.go 12.19% <75.00%> (+0.64%) ⬆️
...t/router/pathprocessor/processor_community_burn.go 6.25% <0.00%> (+0.14%) ⬆️
...pathprocessor/processor_community_deploy_assets.go 15.09% <0.00%> (+0.80%) ⬆️
...ocessor/processor_community_deploy_collectibles.go 15.09% <0.00%> (+0.80%) ⬆️
...rocessor/processor_community_deploy_owner_token.go 8.33% <0.00%> (+0.25%) ⬆️
...r/pathprocessor/processor_community_mint_tokens.go 11.26% <0.00%> (+0.45%) ⬆️
...r/pathprocessor/processor_community_remote_burn.go 16.00% <0.00%> (+0.90%) ⬆️
... and 15 more

... and 27 files with indirect coverage changes

@saledjenic saledjenic force-pushed the chore/include-l1-fees branch from 214e425 to 39ed123 Compare January 24, 2025 13:39
@saledjenic
Copy link
Contributor Author

@antdanchenko could you please help on this, cause functional tests must be failing due to missing OVM_GasPriceOracle contract on Anvil?

@saledjenic saledjenic force-pushed the chore/include-l1-fees branch from 39ed123 to 3a81b49 Compare January 24, 2025 15:08
@pavloburykh
Copy link

@pavloburykh could you try again now?

Thanks @saledjenic. Could you please take a look at the ISSUE 2 reported by @VolodLytvynenko?

@saledjenic saledjenic force-pushed the chore/include-l1-fees branch from 3a81b49 to b554ae2 Compare January 28, 2025 10:06
@saledjenic
Copy link
Contributor Author

saledjenic commented Jan 28, 2025

@pavloburykh all that should be already addressed, could you test the mobile app pointing to the most recent changes in this PR?

@pavloburykh
Copy link

@pavloburykh all that should be already addressed, could you test the mobile app pointing to the most recent changes in this PR?

сс @VolodLytvynenko

@saledjenic
Copy link
Contributor Author

I made some comparisons across chains to see how much the values in the Status app differed from the calculations received by Infura's suggestedGasFees call that is used by MetaMask.

Here are the findings:

Mainnet(1):

Status-BaseFee: 	0x1067e80dd (+4403921117WEI) (+4.403921117GWEI) 	Infura-BaseFee: 	3.355443466GWEI
Status-L1 tx fee 	+0WEI (+0GWEI) 
Status-MinPriorityFee: 	0x4b571c0 (+79000000WEI) (+0.079GWEI) 			Infura-MinPriorityFee: 	0.00152421GWEI
Status--------------- 	------- (-------WEI) (-------GWEI) 			Infura-MediumPriorityFee: 	0.625947383GWEI
Status-MaxPriorityFee: 	0x53724e00 (+1400000000WEI) (+1.4GWEI) 			Infura-MaxPriorityFee: 	2GWEI
Status-LowMaxFee: 	0x12b2cb01c (+5019316252WEI) (+5.019316252GWEI) 	Infura-LowMaxFee: 	3.356967676GWEI
Status-MediumMaxFee: 	0x231ab30f9 (+9423237369WEI) (+9.423237369GWEI) 	Infura-MediumMaxFee: 	5.42423154GWEI
Status-HighMaxFee: 	0x33829b1d6 (+13827158486WEI) (+13.827158486GWEI) 	Infura-HighMaxFee: 	9.717519972GWEI

Status-TxEstimatedTime: 		1 (less than minute)
Infura-LOW-WaitTimeEstimate: 		min: 	15sec 	max: 	60sec
Infura-MEDIUM-WaitTimeEstimate: 	min: 	15sec 	max: 	45sec
Infura-HIGH-WaitTimeEstimate: 		min: 	15sec 	max: 	30sec


Optimism(10):

Status-BaseFee: 	0x1ec (+492WEI) (+4.92e-07GWEI) 		Infura-BaseFee: 	3.68e-07GWEI
Status-L1 tx fee 	+318800000000000WEI (+318800GWEI) 
Status-MinPriorityFee: 	0x186a0 (+100000WEI) (+0.0001GWEI) 		Infura-MinPriorityFee: 	0.0001GWEI
Status--------------- 	------- (-------WEI) (-------GWEI) 		Infura-MediumPriorityFee: 	0.0001GWEI
Status-MaxPriorityFee: 	0xf4240 (+1000000WEI) (+0.001GWEI) 		Infura-MaxPriorityFee: 	0.0001GWEI
Status-LowMaxFee: 	0xc0c27 (+789543WEI) (+0.000789543GWEI) 	Infura-LowMaxFee: 	0.000100736GWEI
Status-MediumMaxFee: 	0xc0e13 (+790035WEI) (+0.000790035GWEI) 	Infura-MediumMaxFee: 	0.000101472GWEI
Status-HighMaxFee: 	0xc0fff (+790527WEI) (+0.000790527GWEI) 	Infura-HighMaxFee: 	0.00010368GWEI

Status-TxEstimatedTime: 		1 (less than minute)
Infura-LOW-WaitTimeEstimate: 		min: 	15sec 	max: 	60sec
Infura-MEDIUM-WaitTimeEstimate: 	min: 	15sec 	max: 	45sec
Infura-HIGH-WaitTimeEstimate: 		min: 	15sec 	max: 	30sec

Arbitrum(42161):

Status-BaseFee: 	0xcaf120 (+13300000WEI) (+0.0133GWEI) 		Infura-BaseFee: 	0.01GWEI
Status-L1 tx fee 	+318800000000000WEI (+318800GWEI) 
Status-MinPriorityFee: 	0x0 (+0WEI) (+0GWEI) 				Infura-MinPriorityFee: 	0GWEI
Status--------------- 	------- (-------WEI) (-------GWEI)	 	Infura-MediumPriorityFee: 	0GWEI
Status-MaxPriorityFee: 	0x0 (+0WEI) (+0GWEI) 				Infura-MaxPriorityFee: 	0GWEI
Status-LowMaxFee: 	0xcaf120 (+13300000WEI) (+0.0133GWEI) 		Infura-LowMaxFee: 	0.02GWEI
Status-MediumMaxFee: 	0x195e240 (+26600000WEI) (+0.0266GWEI) 		Infura-MediumMaxFee: 	0.04GWEI
Status-HighMaxFee: 	0x260d360 (+39900000WEI) (+0.0399GWEI) 		Infura-HighMaxFee: 	0.1GWEI

Status-TxEstimatedTime: 		1 (less than minute)
Infura-LOW-WaitTimeEstimate: 		min: 	15sec 	max: 	60sec
Infura-MEDIUM-WaitTimeEstimate: 	min: 	15sec 	max: 	45sec
Infura-HIGH-WaitTimeEstimate: 		min: 	15sec 	max: 	30sec

@saledjenic
Copy link
Contributor Author

saledjenic commented Jan 29, 2025

Please have a look at the second commit of this PR. I've spent some time adjusting the fees we calculate in the Status app and was trying to make them close to the values displayed in Metamask. Some logic for achieving that is added to the second commit, our fees are slightly higher, but that's ok, I guess.

Logic:

  • network congestion is calculated based on priority fee, base fee and gas used ratio
  • based on congestion variadic fee is calculated as networkCongestion x baseFee
  • then low, medium and high fees are calculated as:
    • lowMaxFees = baseFee + lowPriorityFee
    • mediumMaxFees = baseFee + networkCongestion + mediumPriorityFee
    • highMaxFees = 2 x baseFee + networkCongestion + lowPriorityFee

Mainnet(1)

Status-BaseFee: 	0xda74765f (+3665065567WEI) (+3.665065567GWEI) 		Infura-BaseFee: 	3.599977253GWEI
Status-L1 tx fee 	+0WEI (+0GWEI) 
Status-MinPriorityFee: 	0x5265c0 (+5400000WEI) (+0.0054GWEI) 			Infura-MinPriorityFee: 	0.003102GWEI
Status-MedPriorityFee: 	0x3814fea0 (+940900000WEI) (+0.9409GWEI) 		Infura-MediumPriorityFee: 	0.97GWEI
Status-MaxPriorityFee: 	0x7b1ee888 (+2065623176WEI) (+2.065623176GWEI) 		Infura-MaxPriorityFee: 	2GWEI
Status-LowMaxFee: 	0xdac6dc1f (+3670465567WEI) (+3.670465567GWEI) 		Infura-LowMaxFee: 	3.603079253GWEI
Status-MediumMaxFee: 	0x15f5ffe99 (+5895093913WEI) (+5.895093913GWEI) 	Infura-MediumMaxFee: 	6.117967472GWEI
Status-HighMaxFee: 	0x27cde5ee0 (+10684882656WEI) (+10.684882656GWEI) 	Infura-HighMaxFee: 	10.279947682GWEI

Status-TxEstimatedTime:  		1 (less than minute)
Infura-LOW-WaitTimeEstimate: 		min: 	15sec 	max: 	60sec
Infura-MEDIUM-WaitTimeEstimate: 	min: 	15sec 	max: 	45sec
Infura-HIGH-WaitTimeEstimate: 		min: 	15sec 	max: 	30sec

Optimism(10)

Status-BaseFee: 	0x158 (+344WEI) (+3.44e-07GWEI) 		Infura-BaseFee: 	3.34e-07GWEI
Status-L1 tx fee 	+318800000000000WEI (+318800GWEI) 
Status-MinPriorityFee: 	0x3c (+60WEI) (+6e-08GWEI) 			Infura-MinPriorityFee: 	0.0001GWEI
Status-MedPriorityFee: 	0xf4240 (+1000000WEI) (+0.001GWEI) 		Infura-MediumPriorityFee: 	0.0001GWEI
Status-MaxPriorityFee: 	0x1a76ca (+1734346WEI) (+0.001734346GWEI) 	Infura-MaxPriorityFee: 	0.0001GWEI
Status-LowMaxFee: 	0x194 (+404WEI) (+4.04e-07GWEI) 		Infura-LowMaxFee: 	0.000100668GWEI
Status-MediumMaxFee: 	0xf47a0 (+1001376WEI) (+0.001001376GWEI) 	Infura-MediumMaxFee: 	0.000101336GWEI
Status-HighMaxFee: 	0x1a843a (+1737786WEI) (+0.001737786GWEI) 	Infura-HighMaxFee: 	0.00010334GWEI

Status-TxEstimatedTime: 		1 (less than minute)
Infura-LOW-WaitTimeEstimate: 		min: 	15sec 	max: 	60sec
Infura-MEDIUM-WaitTimeEstimate: 	min: 	15sec 	max: 	45sec
Infura-HIGH-WaitTimeEstimate: 		min: 	15sec 	max: 	30sec

Arbitrum(42161)

Status-BaseFee: 	0x9d2a60 (+10300000WEI) (+0.0103GWEI) 		Infura-BaseFee: 	0.01GWEI
Status-L1 tx fee 	+318800000000000WEI (+318800GWEI) 
Status-MinPriorityFee: 	0x0 (+0WEI) (+0GWEI) 				Infura-MinPriorityFee: 	0GWEI
Status-MedPriorityFee: 	0x0 (+0WEI) (+0GWEI) 				Infura-MediumPriorityFee: 	0GWEI
Status-MaxPriorityFee: 	0x0 (+0WEI) (+0GWEI) 				Infura-MaxPriorityFee: 	0GWEI
Status-LowMaxFee: 	0x9d2a60 (+10300000WEI) (+0.0103GWEI) 		Infura-LowMaxFee: 	0.02GWEI
Status-MediumMaxFee: 	0x274a980 (+41200000WEI) (+0.0412GWEI) 		Infura-MediumMaxFee: 	0.04GWEI
Status-HighMaxFee: 	0x623a7c0 (+103000000WEI) (+0.103GWEI) 		Infura-HighMaxFee: 	0.1GWEI

Status-TxEstimatedTime: 		1 (less than minute)
Infura-LOW-WaitTimeEstimate: 		min: 	15sec 	max: 	60sec
Infura-MEDIUM-WaitTimeEstimate: 	min: 	15sec 	max: 	45sec
Infura-HIGH-WaitTimeEstimate: 		min: 	15sec 	max: 	30sec

avgGasUsedRatio := totalGasUsedRatio / float64(len(feeHistory.GasUsedRatio))

priorityWeight := 0.7
gasUsedWeight := 0.3
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe const?
Also I guess writing comment about what they are would be useful for future code reader

@saledjenic saledjenic force-pushed the chore/include-l1-fees branch from f126502 to c9651fa Compare January 29, 2025 09:45
@saledjenic
Copy link
Contributor Author

@ALL @dlipicar @friofry @briansztamfater could you review the second commit, that should bring us closer to metamask values?

@dlipicar
Copy link
Contributor

phew! Alright, looks like we're closer.
I'd love too see how their vs. our values evolve over time to see how each of us deal with different levels of network congestion. Not sure if you have already, otherwise perhaps you could write a quick script to fetch/calculate the values once every few minutes so we can plot them and more clearly compare them.

@saledjenic saledjenic force-pushed the chore/include-l1-fees branch 2 times, most recently from 72ac3ad to 6878af5 Compare January 30, 2025 19:52
… response

While ago we've disabled l1 info cause the estimated L1 fees were significantly higher than they should have been
(if I remember well, the L1 fees were about 1000 times higher than they should have been).

From this point, that wrong value might be coming from unreliable pokt calls/values, these changes bring them back.
@saledjenic saledjenic force-pushed the chore/include-l1-fees branch from 6878af5 to e0ac920 Compare January 30, 2025 21:58
…estimating l1 fee

- A new contract is used for estimating L1 fee.
- New contract's addresses are known only for Optimims and Sepolia Optimimsm.
- Old contract and addresses per chain are kept so far, but not in use anymore.

Comparing to other wallets, seems L1 fee is added to the total fee only for the Optimims chain.
So we're doing the same in this commit, disabling L1 fees for other than the Optimism.
@saledjenic saledjenic merged commit c4dca62 into develop Jan 31, 2025
19 checks passed
@saledjenic saledjenic deleted the chore/include-l1-fees branch January 31, 2025 20: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.

6 participants