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

merge master into v12.0.0 #25389

Closed
wants to merge 23 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
54e080d
Version-v11.16.11
hjetpoluru Jun 13, 2024
9d6eaa1
feat: PPOM version update (#25298)
jpuri Jun 13, 2024
3464aea
fix (cherry-pick) : hide privacy policy toast during onboarding, and …
jonybur Jun 13, 2024
18ec699
fix: @metamask/smart-transactions-controller@^10.0.1->^10.1.1 (#25030)
legobeat Jun 5, 2024
ab468eb
fix: @metamask/smart-transactions-controller@^10.1.1->^10.1.2 (#25069)
dan437 Jun 6, 2024
854d54c
Update lavamoat policies for the Version-v11.16.11-stx-controller che…
danjm Jun 13, 2024
1c99860
Merge pull request #25301 from MetaMask/Version-v11.16.11-stx-controller
danjm Jun 14, 2024
51daf28
cherry-pick chore: revert recent gas api endpoint changes (#25230) in…
dbrans Jun 14, 2024
46ea799
Update changelog for v11.16.11
danjm Jun 14, 2024
a115615
Cherry pick 743f5ec pr25306 to v11.16.11 (#25333)
danjm Jun 14, 2024
74f05d7
Merge pull request #25296 from MetaMask/Version-v11.16.11
danjm Jun 14, 2024
7253f78
v11.16.12
danjm Jun 14, 2024
c6dbd72
feat: adds "data collection for marketing" toggles (#24605)
jonybur Jun 12, 2024
3e8ce07
Fix lint errors on commit 5892d7cdc (#25367)
danjm Jun 17, 2024
ed0cc1e
Merge pull request #25330 from MetaMask/Version-v11.16.12
danjm Jun 17, 2024
5937633
Merge remote-tracking branch 'origin/master' into v12.0.0/merge-master
dbrans Jun 18, 2024
6603272
fix yarn.lock
dbrans Jun 18, 2024
01e3b85
fix changelog
dbrans Jun 18, 2024
8ff3c5f
fix yarn.lock again
dbrans Jun 18, 2024
4809408
Update LavaMoat policies
metamaskbot Jun 18, 2024
246a867
fix yarn.lock take 3
dbrans Jun 18, 2024
275ecf9
Update LavaMoat policies
metamaskbot Jun 18, 2024
ecab5ae
fix (cherry-pick 25390): Fix unit and e2e tests that were expected th…
danjm Jun 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,630 changes: 2,630 additions & 0 deletions .yarn/patches/@metamask-gas-fee-controller-npm-15.1.2-db4d2976aa.patch

Large diffs are not rendered by default.

12 changes: 10 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

## [12.0.0]

## [11.16.12]

## [11.16.11]
### Fixed
- Ensure network requests for phishing lists are not sent if the Basic Functionality Toggle is off ([#25306](https://github.com/MetaMask/metamask-extension/pull/25306))

## [11.16.10]
### Fixed
- Capture Segment errors during initialization ([#25253](https://github.com/MetaMask/metamask-extension/pull/25253))
Expand Down Expand Up @@ -4810,8 +4817,9 @@ Update styles and spacing on the critical error page ([#20350](https://github.c


[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v12.0.0...HEAD
[12.0.0]: https://github.com/MetaMask/metamask-extension/compare/v11.16.7...v12.0.0
[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v11.16.10...HEAD
[12.0.0]: https://github.com/MetaMask/metamask-extension/compare/v11.16.12...v12.0.0
[11.16.12]: https://github.com/MetaMask/metamask-extension/compare/v11.16.11...v11.16.12
[11.16.11]: https://github.com/MetaMask/metamask-extension/compare/v11.16.10...v11.16.11
[11.16.10]: https://github.com/MetaMask/metamask-extension/compare/v11.16.9...v11.16.10
[11.16.9]: https://github.com/MetaMask/metamask-extension/compare/v11.16.8...v11.16.9
[11.16.8]: https://github.com/MetaMask/metamask-extension/compare/v11.16.7...v11.16.8
Expand Down
46 changes: 46 additions & 0 deletions app/_locales/en/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions app/scripts/controllers/app-state.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export default class AppStateController extends EventEmitter {
showAccountBanner: true,
trezorModel: null,
currentPopupId: undefined,
onboardingDate: null,
newPrivacyPolicyToastClickedOrClosed: null,
newPrivacyPolicyToastShownDate: null,
// This key is only used for checking if the user had set advancedGasFee
Expand Down Expand Up @@ -186,6 +187,12 @@ export default class AppStateController extends EventEmitter {
});
}

setOnboardingDate() {
this.store.updateState({
onboardingDate: Date.now(),
});
}

setNewPrivacyPolicyToastClickedOrClosed() {
this.store.updateState({
newPrivacyPolicyToastClickedOrClosed: true,
Expand Down
11 changes: 11 additions & 0 deletions app/scripts/controllers/metametrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ export default class MetaMetricsController {
this.store = new ObservableStore({
participateInMetaMetrics: null,
metaMetricsId: null,
dataCollectionForMarketing: null,
eventsBeforeMetricsOptIn: [],
traits: {},
previousUserTraits: {},
Expand Down Expand Up @@ -475,6 +476,12 @@ export default class MetaMetricsController {
return metaMetricsId;
}

setDataCollectionForMarketing(dataCollectionForMarketing) {
const { metaMetricsId } = this.state;
this.store.updateState({ dataCollectionForMarketing });
return metaMetricsId;
}

get state() {
return this.store.getState();
}
Expand Down Expand Up @@ -828,6 +835,10 @@ export default class MetaMetricsController {
metamaskState.securityAlertsEnabled ? ['blockaid'] : [],
[MetaMetricsUserTrait.PetnameAddressCount]:
this._getPetnameAddressCount(metamaskState),
[MetaMetricsUserTrait.IsMetricsOptedIn]:
metamaskState.participateInMetaMetrics,
[MetaMetricsUserTrait.HasMarketingConsent]:
metamaskState.dataCollectionForMarketing,
};

if (!previousUserTraits) {
Expand Down
2 changes: 2 additions & 0 deletions app/scripts/lib/setupSentry.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ export const SENTRY_BACKGROUND_STATE = {
browserEnvironment: true,
connectedStatusPopoverHasBeenShown: true,
currentPopupId: false,
onboardingDate: false,
currentExtensionPopupId: false,
defaultHomeActiveTabName: true,
fullScreenGasPollTokens: true,
Expand Down Expand Up @@ -169,6 +170,7 @@ export const SENTRY_BACKGROUND_STATE = {
previousUserTraits: false,
segmentApiCalls: false,
traits: false,
dataCollectionForMarketing: false,
},
NameController: {
names: false,
Expand Down
27 changes: 23 additions & 4 deletions app/scripts/metamask-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,11 @@ import { toChecksumHexAddress } from '../../shared/modules/hexstring-utils';
///: END:ONLY_INCLUDE_IF

import { AssetType, TokenStandard } from '../../shared/constants/transaction';
import { SWAPS_CLIENT_ID } from '../../shared/constants/swaps';
import {
GAS_API_BASE_URL,
GAS_DEV_API_BASE_URL,
SWAPS_CLIENT_ID,
} from '../../shared/constants/swaps';
import {
CHAIN_IDS,
NETWORK_TYPES,
Expand Down Expand Up @@ -781,6 +785,10 @@ export default class MetamaskController extends EventEmitter {
allowedEvents: ['NetworkController:stateChange'],
});

const gasApiBaseUrl = process.env.SWAPS_USE_DEV_APIS
? GAS_DEV_API_BASE_URL
: GAS_API_BASE_URL;

this.gasFeeController = new GasFeeController({
state: initState.GasFeeController,
interval: 10000,
Expand All @@ -800,12 +808,13 @@ export default class MetamaskController extends EventEmitter {
),
getCurrentAccountEIP1559Compatibility:
this.getCurrentAccountEIP1559Compatibility.bind(this),
legacyAPIEndpoint: `${gasApiBaseUrl}/networks/<chain_id>/gasPrices`,
EIP1559APIEndpoint: `${gasApiBaseUrl}/networks/<chain_id>/suggestedGasFees`,
getCurrentNetworkLegacyGasAPICompatibility: () => {
const { chainId } = this.networkController.state.providerConfig;
return chainId === CHAIN_IDS.BSC;
},
getChainId: () => this.networkController.state.providerConfig.chainId,
infuraAPIKey: opts.infuraProjectId,
});

this.appStateController = new AppStateController({
Expand Down Expand Up @@ -859,8 +868,6 @@ export default class MetamaskController extends EventEmitter {
stalelistRefreshInterval: process.env.IN_TEST ? 30 * SECOND : undefined,
});

this.phishingController.maybeUpdateState();

///: BEGIN:ONLY_INCLUDE_IF(blockaid)
this.ppomController = new PPOMController({
messenger: this.controllerMessenger.getRestricted({
Expand Down Expand Up @@ -2345,7 +2352,13 @@ export default class MetamaskController extends EventEmitter {
}

postOnboardingInitialization() {
const { usePhishDetect } = this.preferencesController.store.getState();

this.networkController.lookupNetwork();

if (usePhishDetect) {
this.phishingController.maybeUpdateState();
}
}

triggerNetworkrequests() {
Expand Down Expand Up @@ -3067,6 +3080,10 @@ export default class MetamaskController extends EventEmitter {
metaMetricsController.setParticipateInMetaMetrics.bind(
metaMetricsController,
),
setDataCollectionForMarketing:
metaMetricsController.setDataCollectionForMarketing.bind(
metaMetricsController,
),
setCurrentLocale: preferencesController.setCurrentLocale.bind(
preferencesController,
),
Expand Down Expand Up @@ -3273,6 +3290,8 @@ export default class MetamaskController extends EventEmitter {
appStateController.setSurveyLinkLastClickedOrClosed.bind(
appStateController,
),
setOnboardingDate:
appStateController.setOnboardingDate.bind(appStateController),
setNewPrivacyPolicyToastClickedOrClosed:
appStateController.setNewPrivacyPolicyToastClickedOrClosed.bind(
appStateController,
Expand Down
1 change: 0 additions & 1 deletion lavamoat/browserify/beta/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -1469,7 +1469,6 @@
"@metamask/eth-query": true,
"@metamask/gas-fee-controller>@metamask/controller-utils": true,
"bn.js": true,
"browserify>buffer": true,
"uuid": true
}
},
Expand Down
1 change: 0 additions & 1 deletion lavamoat/browserify/flask/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -1614,7 +1614,6 @@
"@metamask/eth-query": true,
"@metamask/gas-fee-controller>@metamask/controller-utils": true,
"bn.js": true,
"browserify>buffer": true,
"uuid": true
}
},
Expand Down
1 change: 0 additions & 1 deletion lavamoat/browserify/main/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -1469,7 +1469,6 @@
"@metamask/eth-query": true,
"@metamask/gas-fee-controller>@metamask/controller-utils": true,
"bn.js": true,
"browserify>buffer": true,
"uuid": true
}
},
Expand Down
1 change: 0 additions & 1 deletion lavamoat/browserify/mmi/policy.json
Original file line number Diff line number Diff line change
Expand Up @@ -1754,7 +1754,6 @@
"@metamask/eth-query": true,
"@metamask/gas-fee-controller>@metamask/controller-utils": true,
"bn.js": true,
"browserify>buffer": true,
"uuid": true
}
},
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,12 @@
"@expo/config-plugins/glob": "^10.3.10",
"@metamask/network-controller": "patch:@metamask/network-controller@npm%3A18.1.2#~/.yarn/patches/@metamask-network-controller-npm-18.1.2-1bcb8d8610.patch",
"@solana/web3.js/rpc-websockets": "^8.0.1",
"@metamask/nonce-tracker@npm:^5.0.0": "patch:@metamask/nonce-tracker@npm%3A5.0.0#~/.yarn/patches/@metamask-nonce-tracker-npm-5.0.0-d81478218e.patch"
"@metamask/nonce-tracker@npm:^5.0.0": "patch:@metamask/nonce-tracker@npm%3A5.0.0#~/.yarn/patches/@metamask-nonce-tracker-npm-5.0.0-d81478218e.patch",
"@metamask/gas-fee-controller@npm:^15.1.1": "patch:@metamask/gas-fee-controller@npm%3A15.1.2#~/.yarn/patches/@metamask-gas-fee-controller-npm-15.1.2-db4d2976aa.patch"
},
"dependencies": {
"@babel/runtime": "patch:@babel/runtime@npm%3A7.24.0#~/.yarn/patches/@babel-runtime-npm-7.24.0-7eb1dd11a2.patch",
"@blockaid/ppom_release": "^1.4.6",
"@blockaid/ppom_release": "^1.4.7",
"@contentful/rich-text-html-renderer": "^16.3.5",
"@ensdomains/content-hash": "^2.5.7",
"@ethereumjs/tx": "^4.1.1",
Expand Down Expand Up @@ -306,7 +307,7 @@
"@metamask/ethjs": "^0.6.0",
"@metamask/ethjs-contract": "^0.4.1",
"@metamask/ethjs-query": "^0.7.1",
"@metamask/gas-fee-controller": "^15.1.2",
"@metamask/gas-fee-controller": "patch:@metamask/gas-fee-controller@npm%3A15.1.2#~/.yarn/patches/@metamask-gas-fee-controller-npm-15.1.2-db4d2976aa.patch",
"@metamask/jazzicon": "^2.0.0",
"@metamask/keyring-api": "^6.3.1",
"@metamask/keyring-controller": "patch:@metamask/keyring-controller@npm%3A15.0.0#~/.yarn/patches/@metamask-keyring-controller-npm-15.0.0-fa070ce311.patch",
Expand Down
2 changes: 1 addition & 1 deletion privacy-snapshot.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"etherscan.io",
"execution.metamask.io",
"fonts.gstatic.com",
"gas.api.infura.io",
"gas.api.cx.metamask.io",
"github.com",
"goerli.infura.io",
"localhost:8000",
Expand Down
9 changes: 9 additions & 0 deletions shared/constants/metametrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,14 @@ export type MetaMetricsUserTraits = {
};

export enum MetaMetricsUserTrait {
/**
* Identifies if the user has opted in for MetaMetrics
*/
IsMetricsOptedIn = 'is_metrics_opted_in',
/**
* Identifies is the user has given marketing consent
*/
HasMarketingConsent = 'has_marketing_consent',
/**
* Identified when the user adds or modifies addresses in the address book.
*/
Expand Down Expand Up @@ -505,6 +513,7 @@ export enum MetaMetricsEventName {
AccountRenamed = 'Account Renamed',
ActivityDetailsOpened = 'Activity Details Opened',
ActivityDetailsClosed = 'Activity Details Closed',
AnalyticsPreferenceSelected = 'Analytics Preference Selected',
AppInstalled = 'App Installed',
AppUnlocked = 'App Unlocked',
AppUnlockedFailed = 'App Unlocked Failed',
Expand Down
2 changes: 1 addition & 1 deletion shared/constants/swaps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ const SWAPS_TESTNET_CHAIN_ID = '0x539';
export const SWAPS_API_V2_BASE_URL = 'https://swap.api.cx.metamask.io';
export const SWAPS_DEV_API_V2_BASE_URL = 'https://swap.dev-api.cx.metamask.io';
export const TOKEN_API_BASE_URL = 'https://tokens.api.cx.metamask.io';
export const GAS_API_BASE_URL = 'https://gas.api.infura.io';
export const GAS_API_BASE_URL = 'https://gas.api.cx.metamask.io';
export const GAS_DEV_API_BASE_URL = 'https://gas.uat-api.cx.metamask.io';

const BSC_DEFAULT_BLOCK_EXPLORER_URL = 'https://bscscan.com/';
Expand Down
3 changes: 2 additions & 1 deletion shared/lib/swaps-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import log from 'loglevel';
import { CHAIN_IDS } from '../constants/network';
import {
GAS_API_BASE_URL,
GAS_DEV_API_BASE_URL,
SWAPS_API_V2_BASE_URL,
SWAPS_CHAINID_DEFAULT_TOKEN_MAP,
SWAPS_CLIENT_ID,
Expand Down Expand Up @@ -130,8 +131,8 @@ const getBaseUrlForNewSwapsApi = (type, chainId) => {
const v2ApiBaseUrl = useDevApis
? SWAPS_DEV_API_V2_BASE_URL
: SWAPS_API_V2_BASE_URL;
const gasApiBaseUrl = GAS_API_BASE_URL;
const tokenApiBaseUrl = TOKEN_API_BASE_URL;
const gasApiBaseUrl = useDevApis ? GAS_DEV_API_BASE_URL : GAS_API_BASE_URL;
const noNetworkSpecificTypes = ['refreshTime']; // These types don't need network info in the URL.
if (noNetworkSpecificTypes.includes(type)) {
return v2ApiBaseUrl;
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/default-fixture.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ function defaultFixture(inputChainId = CHAIN_IDS.LOCALHOST) {
'__FIXTURE_SUBSTITUTION__currentDateInMilliseconds',
showTestnetMessageInDropdown: true,
trezorModel: null,
newPrivacyPolicyToastClickedOrClosed: true,
newPrivacyPolicyToastShownDate: Date.now(),
usedNetworks: {
[CHAIN_IDS.MAINNET]: true,
[CHAIN_IDS.LINEA_MAINNET]: true,
Expand Down
Loading