Skip to content

Commit 8082fea

Browse files
saledjenicalaibefriofryalexjba
authored
chore: merge branch 'release/10.34.x' into develop (#7453)
* chore: remove Polygon zkEVM chain (#7429) * chore: remove status l2 sepolia (#7431) * fix(wallet-connect): advertise wallet_switchEthereumChain (#7432) Fixes #20697 * fix(connector): EIP-5792 methods + trusted-only eth_accounts auto-share on requestPermissions (#7428) fix(connector): partial permissions revocation fix(connector): parallel dapp requests races fixes status-im/status-app#20591 * feat(connector): ephemeral dApp records (#7435) * feat(connector): ephemeral dapp records refs status-im/status-app#20676 * fix: copilot comments * chore: more descriptive logging added to router package * feat: implemented log file rotation for new sessions Added functionality to rotate log files when a new session starts, while the logs from previous sessions are also kept. * fix: puzzle-auth providers should not depend on the presence/absence of basic-auth credentials (#7437) * fix: puzzle-auth providers should not depend on the presence/absence of basic-auth credentials If the same network has puzzle-auth and basic-auth providers an incorrect enable flag might be used if there is no ethrpc/status proxy credentials set. * chore: sync balance/activity fetching (#7438) * chore: trigger activity fetch when balance updated * chore: trigger balance update when activity fetched * fix(wc): reconnect broken pipe fixes status-app/status-im#20767 * fix(wc): recreate ws connection on start * fixes broken wc after restoring from the background fixes status-app/status-im#20767 * fix: copilot comments * fix: shrink tests * fix: use WCClientGetter * wcclient is recreated when service is paused * fix: readability * fix: pr comments * fix: flaky test * fix: push notification migration If the latest migration ran is not present then remove it * perf: Enrich community members and contacts with visual identity (#7430) For each community member and contact Status needs to wire another 4 RPCs to fully resolve the members and contacts. This commit adds the necessary info in the community members and contacts response directly. Needed for: status-im/status-app#20228 * fix(collectibles): disable ink, katana fixes status-im/status-app#20717 * fix(collectibles): pr comments * feat(wallet): skip TANGYUAN and POSI tokens on BSCMainnet Added token keys for TANGYUAN and POSI to the SkippedTokenKeys list. Closes #20860 * perf: Interrupt stats ticker and throttle mvds on messenger.pause The messenger needs to keep only critical infrastructure while paused. This commit stops the stats retrieval while paused - not used. And throttles the mvds datasync to 5 minutes. This means that the ack is confirmed once every 5 minutes (as opposed to 300ms) while paused. Message sending is also disabled in this time frame. --------- Co-authored-by: Anthony Laibe <491074+alaibe@users.noreply.github.com> Co-authored-by: Andrey Bocharnikov <andrey.bocharnikov@gmail.com> Co-authored-by: Alex Jbanca <47811206+alexjba@users.noreply.github.com> Co-authored-by: Alex Jbanca <alexjb@status.im>
1 parent 2cd0d08 commit 8082fea

78 files changed

Lines changed: 3346 additions & 1020 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

internal/contracts/community-tokens/deployer/address.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ var contractAddressByChainID = map[uint64]common.Address{
2121
walletCommon.ArbitrumSepolia: common.HexToAddress("0x7Ff554af5b6624db2135E4364F416d1D397f43e6"),
2222
walletCommon.OptimismSepolia: common.HexToAddress("0xcE2A896eEA2F585BC0C3753DC8116BbE2AbaE541"),
2323
walletCommon.BaseSepolia: common.HexToAddress("0x7Ff554af5b6624db2135E4364F416d1D397f43e6"),
24-
walletCommon.StatusNetworkSepolia: common.HexToAddress("0x06716eCfA9B5Ae0210F4c3279cA304A7F563c59e"),
2524
walletCommon.BSCMainnet: common.HexToAddress("0x76d0e484e7c3398922636960ab33bde6e9936d81"),
2625
walletCommon.BSCTestnet: common.HexToAddress("0x7Ff554af5b6624db2135E4364F416d1D397f43e6"),
2726
walletCommon.LineaMainnet: common.HexToAddress(""), // TODO: add address

internal/contracts/hop/address.go

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -330,30 +330,6 @@ var hopBridgeContractAddresses = map[uint64]map[common.Address]map[string]common
330330
L2SaddleLpToken: common.HexToAddress("0x0000000000000000000000000000000000000000"),
331331
},
332332
},
333-
walletCommon.PolygonZkEVMMainnet: {
334-
common.HexToAddress("0x0000000000000000000000000000000000000000"): { // ETH
335-
L1CanonicalBridge: common.HexToAddress("0x0000000000000000000000000000000000000000"),
336-
L1MessengerWrapper: common.HexToAddress("0x2Af8821657973a9CA39248a7586fB588a4686630"),
337-
L2CanonicalBridge: common.HexToAddress("0x0000000000000000000000000000000000000000"),
338-
L2CanonicalToken: common.HexToAddress("0x4F9A0e7FD2Bf6067db6994CF12E4495Df938E6e9"),
339-
L2Bridge: common.HexToAddress("0x0ce6c85cF43553DE10FC56cecA0aef6Ff0DD444d"),
340-
L2HopBridgeToken: common.HexToAddress("0x652a38FA87f60A122AEF360eEeFcaf6258eDdF6A"),
341-
L2AmmWrapper: common.HexToAddress("0xbd72882120508518FCba2AE58E134EceaD18d979"),
342-
L2SaddleSwap: common.HexToAddress("0x0a6b1904369fE59E002ad0713ae89d4E3dF5A7Cf"),
343-
L2SaddleLpToken: common.HexToAddress("0x611c4F1539653174B05508a4169e188f9521a5bB"),
344-
},
345-
common.HexToAddress("0xc5102fE9359FD9a28f877a67E36B0F050d81a3CC"): { // HOP
346-
L1CanonicalBridge: common.HexToAddress("0x0000000000000000000000000000000000000000"),
347-
L1MessengerWrapper: common.HexToAddress("0x053Aa6D73cd1Ea062130F053c7421724754E08D8"),
348-
L2CanonicalBridge: common.HexToAddress("0x0000000000000000000000000000000000000000"),
349-
L2CanonicalToken: common.HexToAddress("0xc5102fE9359FD9a28f877a67E36B0F050d81a3CC"),
350-
L2Bridge: common.HexToAddress("0x9ec9551d4A1a1593b0ee8124D98590CC71b3B09D"),
351-
L2HopBridgeToken: common.HexToAddress("0xc5102fE9359FD9a28f877a67E36B0F050d81a3CC"),
352-
L2AmmWrapper: common.HexToAddress("0x0000000000000000000000000000000000000000"),
353-
L2SaddleSwap: common.HexToAddress("0x0000000000000000000000000000000000000000"),
354-
L2SaddleLpToken: common.HexToAddress("0x0000000000000000000000000000000000000000"),
355-
},
356-
},
357333
walletCommon.EthereumSepolia: {
358334
common.HexToAddress("0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238"): { // USDC
359335
L1CanonicalToken: common.HexToAddress("0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238"),

internal/contracts/snt/address.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ var contractAddressByChainID = map[uint64]common.Address{
1616
560048: common.HexToAddress("0x0B5DAd18B8791ddb24252B433ec4f21f9e6e5Ed0"), // hoodi
1717
11155111: common.HexToAddress("0xE452027cdEF746c7Cd3DB31CB700428b16cD8E51"), // sepolia
1818
84532: common.HexToAddress("0xfdb3b57944943a7724fcc0520ee2b10659969a06"), // base testnet
19-
1660990954: common.HexToAddress("0x1c3ac2a186c6149ae7cb4d716ebbd0766e4f898a"), // status testnet
2019
}
2120

2221
func ContractAddress(chainID uint64) (common.Address, error) {

internal/db/multiaccounts/accounts/database.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ var (
4747
const (
4848
ProdPreferredChainIDsDefault = "1:10:42161:8453"
4949
TestPreferredChainIDsDefault = "5:420:421613"
50-
TestSepoliaPreferredChainIDsDefault = "11155111:11155420:421614:84532:1660990954"
50+
TestSepoliaPreferredChainIDsDefault = "11155111:11155420:421614:84532"
5151
)
5252

5353
// TODO: implement clean full interface. This might require refactoring Database methods

internal/db/sqlite/migrate.go

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,8 @@ func UpdateMigrationTableVersion(db *sql.DB, migrationTableName string, assetNam
246246
}
247247

248248
targetVersion := getMaxMigrationVersion(assetNames, maxVersion)
249-
// Never downgrade the version in the migration table!
250-
if targetVersion > 0 && targetVersion > storedVersion {
249+
storedVersionMissing := storedVersion > 0 && !migrationVersionPresent(assetNames, storedVersion)
250+
if targetVersion > 0 && (targetVersion > storedVersion || storedVersionMissing) {
251251
// #nosec G201 -- migrationTableName is a trusted constant, not user input
252252
deleteQuery := fmt.Sprintf("DELETE FROM %s", migrationTableName)
253253
_, err = tx.Exec(deleteQuery)
@@ -267,6 +267,19 @@ func UpdateMigrationTableVersion(db *sql.DB, migrationTableName string, assetNam
267267
return err
268268
}
269269

270+
func migrationVersionPresent(assetNames []string, version uint) bool {
271+
for _, name := range assetNames {
272+
m, err := source.DefaultParse(name)
273+
if err != nil {
274+
continue
275+
}
276+
if m.Version == version {
277+
return true
278+
}
279+
}
280+
return false
281+
}
282+
270283
func getMaxMigrationVersion(assetNames []string, max uint) uint {
271284
floor := uint(0)
272285
for _, name := range assetNames {

internal/logutils/logrotation.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
package logutils
22

33
import (
4+
"os"
5+
"path/filepath"
6+
"strings"
7+
"time"
8+
49
"go.uber.org/zap/zapcore"
510
"gopkg.in/natefinch/lumberjack.v2"
611
)
712

13+
// processStartTime represents the start time of this process
14+
var processStartTime = time.Now()
15+
816
// FileOptions are all options supported by internal rotation module.
917
type FileOptions struct {
1018
// Base name for log file.
@@ -26,3 +34,22 @@ func ZapSyncerWithRotation(opts FileOptions) zapcore.WriteSyncer {
2634
Compress: opts.Compress,
2735
})
2836
}
37+
38+
// rotateLogFileForNewSession renames an existing log file so the new process writes to a fresh file.
39+
func rotateLogFileForNewSession(path string) error {
40+
info, err := os.Stat(path)
41+
if err != nil {
42+
if os.IsNotExist(err) {
43+
return nil
44+
}
45+
return err
46+
}
47+
if !info.ModTime().Before(processStartTime) {
48+
return nil
49+
}
50+
ts := info.ModTime().UTC().Format("2006-01-02T15-04-05Z")
51+
ext := filepath.Ext(path)
52+
base := strings.TrimSuffix(path, ext)
53+
archived := base + "-" + ts + ext
54+
return os.Rename(path, archived)
55+
}

internal/logutils/override.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66

77
logging "github.com/ipfs/go-log/v2"
88

9+
"go.uber.org/zap"
910
"go.uber.org/zap/zapcore"
1011
)
1112

@@ -54,6 +55,12 @@ func overrideCoreWithConfig(filteringCore *namespaceFilteringCore, settings LogS
5455
settings.MaxBackups = 1
5556
}
5657

58+
if err := rotateLogFileForNewSession(settings.File); err != nil {
59+
ZapLogger().Warn("failed to rotate log file for new session",
60+
zap.String("file", settings.File),
61+
zap.Error(err))
62+
}
63+
5764
syncers = append(syncers, ZapSyncerWithRotation(FileOptions{
5865
Filename: settings.File,
5966
MaxSize: settings.MaxSize,

internal/transactions/rpc_wrapper.go

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -66,21 +66,7 @@ func (w *rpcWrapper) EstimateGas(ctx context.Context, msg ethereum.CallMsg) (uin
6666
if err != nil {
6767
return 0, err
6868
}
69-
method := "eth_estimateGas"
70-
if w.chainID == walletCommon.StatusNetworkSepolia {
71-
method = "linea_estimateGas"
72-
var result struct {
73-
GasLimit hexutil.Uint64 `json:"gasLimit"`
74-
}
75-
76-
err := ethClient.CallContext(ctx, &result, method, walletCommon.ToCallArg(msg))
77-
if err != nil {
78-
return 0, err
79-
}
80-
return uint64(result.GasLimit), nil
81-
}
82-
83-
err = ethClient.CallContext(ctx, &hex, method, walletCommon.ToCallArg(msg))
69+
err = ethClient.CallContext(ctx, &hex, "eth_estimateGas", walletCommon.ToCallArg(msg))
8470
if err != nil {
8571
return 0, err
8672
}

params/networkdefaults/default_networks_config.go

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -280,54 +280,6 @@ var defaultNetworkSpecs = []networkSpec{
280280
isActive: false,
281281
isDeactivatable: true,
282282
},
283-
{
284-
chainID: common.PolygonZkEVMMainnet,
285-
proxyChainName: "polygon-zkevm",
286-
proxyNetworkName: "mainnet",
287-
chainName: "Polygon zkEVM",
288-
providers: []providerSpec{
289-
{providerType: providerTypeEthRpcProxy, name: common.StatusSmartProxy},
290-
// no support for polygon zkevm on infura
291-
{providerType: providerTypeDirect, name: common.DirectCustom, directURL: security.NewSensitiveString("https://zkevm-rpc.com"), enableRpsLimiter: true},
292-
{providerType: providerTypeEthRpcProxyWithProvider, name: common.SmartProxyAlchemy, targetProvider: common.Alchemy},
293-
},
294-
blockExplorerURL: "https://www.oklink.com/polygon-zkevm/", // this is official, but doesn't work: "https://zkevm.polygonscan.com/",
295-
chainColor: "#7B3FE4",
296-
shortName: "zkevm",
297-
nativeCurrencyName: "Ether",
298-
nativeCurrencySymbol: "ETH",
299-
nativeCurrencyDecimals: 18,
300-
isTest: false,
301-
layer: 2,
302-
enabled: false,
303-
relatedChainID: common.PolygonZkEVMCardona,
304-
isActive: false,
305-
isDeactivatable: true,
306-
},
307-
{
308-
chainID: common.PolygonZkEVMCardona,
309-
proxyChainName: "polygon-zkevm",
310-
proxyNetworkName: "cardona",
311-
chainName: "Polygon zkEVM Cardona",
312-
providers: []providerSpec{
313-
{providerType: providerTypeEthRpcProxy, name: common.StatusSmartProxy},
314-
// no support for polygon zkevm on infura
315-
{providerType: providerTypeDirect, name: common.DirectCustom, directURL: security.NewSensitiveString("https://rpc.cardona.zkevm-rpc.com"), enableRpsLimiter: true},
316-
{providerType: providerTypeEthRpcProxyWithProvider, name: common.SmartProxyAlchemy, targetProvider: common.Alchemy},
317-
},
318-
blockExplorerURL: "https://explorer.zkevm-testnet.com/",
319-
chainColor: "#7B3FE4",
320-
shortName: "zkevm",
321-
nativeCurrencyName: "Ether",
322-
nativeCurrencySymbol: "ETH",
323-
nativeCurrencyDecimals: 18,
324-
isTest: true,
325-
layer: 2,
326-
enabled: false,
327-
relatedChainID: common.PolygonZkEVMMainnet,
328-
isActive: false,
329-
isDeactivatable: true,
330-
},
331283
{
332284
chainID: common.UnichainMainnet,
333285
proxyChainName: "unichain",
@@ -720,28 +672,6 @@ var defaultNetworkSpecs = []networkSpec{
720672
isActive: false,
721673
isDeactivatable: true,
722674
},
723-
{
724-
chainID: common.StatusNetworkSepolia,
725-
proxyChainName: "status",
726-
proxyNetworkName: "sepolia",
727-
chainName: "Status Network Sepolia",
728-
providers: []providerSpec{
729-
{providerType: providerTypeEthRpcProxy, name: common.StatusSmartProxy},
730-
{providerType: providerTypeDirect, name: common.DirectStatus, directURL: security.NewSensitiveString("https://public.sepolia.rpc.status.network")},
731-
},
732-
blockExplorerURL: "https://sepoliascan.status.network/",
733-
chainColor: "#7140FD",
734-
shortName: "status",
735-
nativeCurrencyName: "Ether",
736-
nativeCurrencySymbol: "ETH",
737-
nativeCurrencyDecimals: 18,
738-
isTest: true,
739-
layer: 2,
740-
enabled: true,
741-
relatedChainID: 0, // TODO: update related chain id once decided
742-
isActive: true,
743-
isDeactivatable: true,
744-
},
745675
{
746676
chainID: common.BSCMainnet,
747677
proxyChainName: "bsc",

params/networkdefaults/default_networks_test.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func TestBuildDefaultNetworks(t *testing.T) {
2727

2828
actualNetworks := BuildDefaultNetworks(&request.WalletSecretsConfig, true)
2929

30-
require.Len(t, actualNetworks, 32)
30+
require.Len(t, actualNetworks, 29)
3131
for _, n := range actualNetworks {
3232
var err error
3333
switch n.ChainID {
@@ -42,8 +42,6 @@ func TestBuildDefaultNetworks(t *testing.T) {
4242
case common.BaseSepolia:
4343
case common.LineaMainnet:
4444
case common.LineaSepolia:
45-
case common.PolygonZkEVMMainnet:
46-
case common.PolygonZkEVMCardona:
4745
case common.UnichainMainnet:
4846
case common.UnichainSepolia:
4947
case common.KatanaMainnet:
@@ -60,7 +58,6 @@ func TestBuildDefaultNetworks(t *testing.T) {
6058
case common.ScrollSepolia:
6159
case common.BlastMainnet:
6260
case common.BlastSepolia:
63-
case common.StatusNetworkSepolia:
6461
case common.BSCMainnet:
6562
case common.BSCTestnet:
6663
default:

0 commit comments

Comments
 (0)