Skip to content

feat: Implement the publishBatch hook for smart transactions #31267

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

Merged
merged 4 commits into from
Mar 27, 2025
Merged

Conversation

dan437
Copy link
Contributor

@dan437 dan437 commented Mar 25, 2025

Description

This PR implements the publishBatch hook for smart transactions, which will be used when submitting multiple transactions at once, e.g. when a user choose their gas token for a transaction.

We can test this end to end once UI for the Transaction Confirmation page is merged. Then we might need to do some final tweaks if needed.

Open in GitHub Codespaces

Related issues

Fixes:

Manual testing steps

  1. Once the UI on the Transaction Confirmation page is ready (e.g. when you do a Send transaction), you will be able to choose a gas token to be used for transaction fees

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@dan437 dan437 requested a review from a team as a code owner March 25, 2025 10:51
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@dan437 dan437 added the team-transactions Transactions team label Mar 25, 2025
@dan437 dan437 marked this pull request as draft March 25, 2025 10:55
@metamaskbot
Copy link
Collaborator

Builds ready [23830c0]
Page Load Metrics (2344 ± 239 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint156229962158385185
domContentLoaded153528771968331159
load156732332344497239
domInteractive26107462512
backgroundConnect341272406284136
firstReactRender3969712413665
getState2379522520096
initialActions01000
loadScripts11261797137218488
setupStore929912410048
uiStartup174626662580252252509
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 2.23 KiB (0.03%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [47992dd]
Page Load Metrics (3313 ± 1472 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint160216225304930551467
domContentLoaded153515819277130191450
load161016502331330651472
domInteractive25198544622
backgroundConnect781159551258124
firstReactRender422651215828
getState40741309214103
initialActions01000
loadScripts112714756209429141399
setupStore2050216712460
uiStartup209617398670336781766
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 2.23 KiB (0.03%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@dan437 dan437 force-pushed the submit-batch branch 2 times, most recently from 4b6e916 to 9143c77 Compare March 26, 2025 15:45
Use the PublishBatchHookRequest type

Signed-off-by: dan437 <[email protected]>

Make transactionMeta mandatory for submitBatch, export getTransactionById, refactoring

Signed-off-by: dan437 <[email protected]>
@dan437 dan437 marked this pull request as ready for review March 27, 2025 15:22
@dan437 dan437 requested review from httpJunkie and klejeune March 27, 2025 15:24
@dan437 dan437 enabled auto-merge March 27, 2025 16:43
@metamaskbot
Copy link
Collaborator

Builds ready [68a7c06]
UI Startup Metrics (1272 ± 60 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1272114514256013181373
load1114100912715711481217
domContentLoaded1108100212665711431211
domInteractive18134761733
firstPaint776831270435217287
backgroundConnect117547910
firstReactRender21146282244
getState11434779
initialActions001001
loadScripts84372799356873950
setupStore8527379
WebpackHomeuiStartup923838106656946963
load79360491058826882
domContentLoaded78759990358821874
domInteractive15124671335
firstPaint43855868325817860
backgroundConnect15113141525
firstReactRender13122611314
getState6312167
initialActions001000
loadScripts78558989358820864
setupStore7410189
FirefoxBrowserifyHomeuiStartup14001216206215914521816
load12541067190515413111659
domContentLoaded12541067190515413101659
domInteractive10643282338695
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2617120132547
firstReactRender25196992551
getState7339478
initialActions001001
loadScripts12291047188215312911637
setupStore6414267
WebpackHomeuiStartup9868411545167891979
load8657371393151802900
domContentLoaded8657361393151802900
domInteractive117331982814495
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect211482112338
firstReactRender19163421924
getState94731079
initialActions001001
loadScripts8477221367146817977
setupStore7479778
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 2.31 KiB (0.04%)
  • ui: 0 Bytes (0%)
  • common: 0 Bytes (0%)

@dan437 dan437 added this pull request to the merge queue Mar 27, 2025
auto-merge was automatically disabled March 27, 2025 17:53

Pull Request is not mergeable

Merged via the queue into main with commit ce7aa93 Mar 27, 2025
147 checks passed
@dan437 dan437 deleted the submit-batch branch March 27, 2025 18:20
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2025
@metamaskbot metamaskbot added the release-12.17.0 Issue or pull request that will be included in release 12.17.0 label Mar 27, 2025
@dan437
Copy link
Contributor Author

dan437 commented Mar 27, 2025

Thanks a lot for great feedback, @matthewwalsh0 . It seems the PR got approved and automatically merged for today's release candidate, since it's very high priority. I will send a follow up PR which addresses your comments and get that cherry picked into the RC.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.17.0 Issue or pull request that will be included in release 12.17.0 team-transactions Transactions team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants