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 develop to main #478

Merged
merged 22 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
bc575e0
feat: add retries, add sleep between attempts
solidovic Sep 5, 2024
299f5ce
feat: send startup metrics after all attempts
solidovic Sep 5, 2024
0ebd59c
refactor: counter to Gauge
solidovic Sep 5, 2024
263ac4c
Merge branch 'develop' into feature/si-1468-staking-widget-oncall-upd…
solidovic Sep 6, 2024
ded5279
fix: make "you will receive" row always first
alx-khramov Sep 10, 2024
6691fe2
Merge branch 'develop' into feature/si-1468-staking-widget-oncall-upd…
solidovic Sep 16, 2024
f3e3ed4
refactor: startup check of RPCs (promises)
solidovic Sep 16, 2024
de31eed
Merge remote-tracking branch 'origin/feature/si-1468-staking-widget-o…
solidovic Sep 16, 2024
c01adec
fix: correct locator abi
Jeday Sep 16, 2024
b2ef17d
refactor: return Promise in getRPCChecks
solidovic Sep 16, 2024
164f1d3
Merge branch 'develop' of github.com:lidofinance/ethereum-staking-wid…
Jeday Sep 17, 2024
1cefd50
fix: short revalidation
Jeday Sep 17, 2024
91dbaea
fix: default revalidation
Jeday Sep 17, 2024
a61e6fc
feat: reef-knot 5.6.0
alx-khramov Sep 17, 2024
3d4181b
fix: batch withdrawal status requests
Jeday Sep 18, 2024
9b38d02
Merge pull request #456 from lidofinance/feature/si-1468-staking-widg…
itaven Sep 18, 2024
75bd625
fix: increase custom server security
Jeday Sep 18, 2024
ffed485
fix: catch for eth_call metric
Jeday Sep 18, 2024
7605833
Merge pull request #475 from lidofinance/feature/si-1600-whitelist-fo…
itaven Sep 18, 2024
ec0a5b8
Merge pull request #464 from lidofinance/feature/si-908-you-will-rece…
jake4take Sep 18, 2024
13d1c48
feat: add matomo events for coinbase smart wallet
alx-khramov Sep 18, 2024
a0c3e22
Merge pull request #476 from lidofinance/feature/si-1608-reef-knot-56…
itaven Sep 19, 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
236 changes: 151 additions & 85 deletions abi/lidoLocator.abi.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,134 +2,200 @@
{
"inputs": [
{
"internalType": "address",
"name": "implementation_",
"type": "address"
},
{ "internalType": "address", "name": "admin_", "type": "address" },
{ "internalType": "bytes", "name": "data_", "type": "bytes" }
"components": [
{
"internalType": "address",
"name": "accountingOracle",
"type": "address"
},
{
"internalType": "address",
"name": "depositSecurityModule",
"type": "address"
},
{
"internalType": "address",
"name": "elRewardsVault",
"type": "address"
},
{
"internalType": "address",
"name": "legacyOracle",
"type": "address"
},
{ "internalType": "address", "name": "lido", "type": "address" },
{
"internalType": "address",
"name": "oracleReportSanityChecker",
"type": "address"
},
{
"internalType": "address",
"name": "postTokenRebaseReceiver",
"type": "address"
},
{ "internalType": "address", "name": "burner", "type": "address" },
{
"internalType": "address",
"name": "stakingRouter",
"type": "address"
},
{ "internalType": "address", "name": "treasury", "type": "address" },
{
"internalType": "address",
"name": "validatorsExitBusOracle",
"type": "address"
},
{
"internalType": "address",
"name": "withdrawalQueue",
"type": "address"
},
{
"internalType": "address",
"name": "withdrawalVault",
"type": "address"
},
{
"internalType": "address",
"name": "oracleDaemonConfig",
"type": "address"
}
],
"internalType": "struct LidoLocator.Config",
"name": "_config",
"type": "tuple"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{ "inputs": [], "name": "NotAdmin", "type": "error" },
{ "inputs": [], "name": "ProxyIsOssified", "type": "error" },
{ "inputs": [], "name": "ZeroAddress", "type": "error" },
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "previousAdmin",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "newAdmin",
"type": "address"
}
],
"name": "AdminChanged",
"type": "event"
"inputs": [],
"name": "accountingOracle",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "beacon",
"type": "address"
}
"inputs": [],
"name": "burner",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "coreComponents",
"outputs": [
{ "internalType": "address", "name": "", "type": "address" },
{ "internalType": "address", "name": "", "type": "address" },
{ "internalType": "address", "name": "", "type": "address" },
{ "internalType": "address", "name": "", "type": "address" },
{ "internalType": "address", "name": "", "type": "address" },
{ "internalType": "address", "name": "", "type": "address" }
],
"name": "BeaconUpgraded",
"type": "event"
"stateMutability": "view",
"type": "function"
},
{
"anonymous": false,
"inputs": [],
"name": "ProxyOssified",
"type": "event"
"name": "depositSecurityModule",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "implementation",
"type": "address"
}
],
"name": "Upgraded",
"type": "event"
"inputs": [],
"name": "elRewardsVault",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{ "stateMutability": "payable", "type": "fallback" },
{
"inputs": [
{ "internalType": "address", "name": "newAdmin_", "type": "address" }
"inputs": [],
"name": "legacyOracle",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "lido",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "oracleDaemonConfig",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "oracleReportComponentsForLido",
"outputs": [
{ "internalType": "address", "name": "", "type": "address" },
{ "internalType": "address", "name": "", "type": "address" },
{ "internalType": "address", "name": "", "type": "address" },
{ "internalType": "address", "name": "", "type": "address" },
{ "internalType": "address", "name": "", "type": "address" },
{ "internalType": "address", "name": "", "type": "address" },
{ "internalType": "address", "name": "", "type": "address" }
],
"name": "proxy__changeAdmin",
"outputs": [],
"stateMutability": "nonpayable",
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "proxy__getAdmin",
"name": "oracleReportSanityChecker",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "proxy__getImplementation",
"name": "postTokenRebaseReceiver",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "proxy__getIsOssified",
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"name": "stakingRouter",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "proxy__ossify",
"outputs": [],
"stateMutability": "nonpayable",
"name": "treasury",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newImplementation_",
"type": "address"
}
],
"name": "proxy__upgradeTo",
"outputs": [],
"stateMutability": "nonpayable",
"inputs": [],
"name": "validatorsExitBusOracle",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newImplementation_",
"type": "address"
},
{ "internalType": "bytes", "name": "setupCalldata_", "type": "bytes" },
{ "internalType": "bool", "name": "forceCall_", "type": "bool" }
],
"name": "proxy__upgradeToAndCall",
"outputs": [],
"stateMutability": "nonpayable",
"inputs": [],
"name": "withdrawalQueue",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{ "stateMutability": "payable", "type": "receive" }
{
"inputs": [],
"name": "withdrawalVault",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
}
]
2 changes: 2 additions & 0 deletions config/get-secret-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ export type SecretConfigType = Modify<
rpcUrls_1: [string, ...string[]];
rpcUrls_17000: [string, ...string[]];
rpcUrls_11155111: [string, ...string[]];
// Dynamic keys like rpcUrls_<number>
[key: `rpcUrls_${number}`]: string[];

cspReportOnly: boolean;

Expand Down
3 changes: 1 addition & 2 deletions config/groups/revalidation.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export const DEFAULT_REVALIDATION = 60 * 15; // 15 minutes
export const ERROR_REVALIDATION_SECONDS = 60; // 1 minute
export const DEFAULT_REVALIDATION = 60; // 1 minute
18 changes: 18 additions & 0 deletions consts/matomo-wallets-events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ export const enum MATOMO_WALLETS_EVENTS_TYPES {
onClickCoin98 = 'onClickCoin98',
onConnectCoin98 = 'onConnectCoin98',
onClickCoinbase = 'onClickCoinbase',
onClickCoinbaseSmartWallet = 'onClickCoinbaseSmartWallet',
onConnectCoinbase = 'onConnectCoinbase',
onConnectCoinbaseSmartWallet = 'onConnectCoinbaseSmartWallet',
onClickExodus = 'onClickExodus',
onConnectExodus = 'onConnectExodus',
onClickImToken = 'onClickImToken',
Expand Down Expand Up @@ -79,6 +81,16 @@ export const MATOMO_WALLETS_EVENTS: Record<
'Connect Coinbase Wallet wallet',
'eth_widget_connect_coinbase_wallet',
],
[MATOMO_WALLETS_EVENTS_TYPES.onClickCoinbaseSmartWallet]: [
'Ethereum_Staking_Widget',
'Click Coinbase Smart Wallet wallet',
'eth_widget_click_coinbase_smart_wallet',
],
[MATOMO_WALLETS_EVENTS_TYPES.onConnectCoinbaseSmartWallet]: [
'Ethereum_Staking_Widget',
'Connect Coinbase Smart Wallet wallet',
'eth_widget_connect_coinbase_smart_wallet',
],
[MATOMO_WALLETS_EVENTS_TYPES.onClickExodus]: [
'Ethereum_Staking_Widget',
'Click Exodus wallet',
Expand Down Expand Up @@ -202,6 +214,9 @@ export const walletsMetrics: Metrics<WalletIdsEthereum> = {
brave: getMetricHandler(MATOMO_WALLETS_EVENTS.onClickBrave),
coin98: getMetricHandler(MATOMO_WALLETS_EVENTS.onClickCoin98),
coinbase: getMetricHandler(MATOMO_WALLETS_EVENTS.onClickCoinbase),
coinbaseSmartWallet: getMetricHandler(
MATOMO_WALLETS_EVENTS.onClickCoinbaseSmartWallet,
),
exodus: getMetricHandler(MATOMO_WALLETS_EVENTS.onClickExodus),
imToken: getMetricHandler(MATOMO_WALLETS_EVENTS.onClickImToken),
ledgerHID: getMetricHandler(MATOMO_WALLETS_EVENTS.onClickLedger),
Expand All @@ -223,6 +238,9 @@ export const walletsMetrics: Metrics<WalletIdsEthereum> = {
brave: getMetricHandler(MATOMO_WALLETS_EVENTS.onConnectBrave),
coin98: getMetricHandler(MATOMO_WALLETS_EVENTS.onConnectCoin98),
coinbase: getMetricHandler(MATOMO_WALLETS_EVENTS.onConnectCoinbase),
coinbaseSmartWallet: getMetricHandler(
MATOMO_WALLETS_EVENTS.onConnectCoinbaseSmartWallet,
),
exodus: getMetricHandler(MATOMO_WALLETS_EVENTS.onConnectExodus),
imToken: getMetricHandler(MATOMO_WALLETS_EVENTS.onConnectImToken),
ledgerHID: getMetricHandler(MATOMO_WALLETS_EVENTS.onConnectLedger),
Expand Down
2 changes: 1 addition & 1 deletion consts/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export const METRICS_PREFIX = 'eth_stake_widget_ui_';

export const enum METRIC_NAMES {
REQUESTS_TOTAL = 'requests_total',
STARTUP_CHECKS_RPC = 'startup_checks_rpc',
STARTUP_CHECKS_RPC_FAILED = 'startup_checks_rpc_failed',
API_RESPONSE = 'api_response',
ETH_CALL_ADDRESS_TO = 'eth_call_address_to',
SSR_COUNT = 'ssr_count',
Expand Down
13 changes: 12 additions & 1 deletion features/withdrawals/hooks/contract/useWithdrawalsData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { standardFetcher } from 'utils/standardFetcher';
import { default as dynamics } from 'config/dynamics';

import { encodeURLQuery } from 'utils/encodeURLQuery';
import type { WithdrawalQueueAbi } from '@lido-sdk/contracts';

export type WithdrawalRequests = NonNullable<
ReturnType<typeof useWithdrawalRequests>['data']
Expand Down Expand Up @@ -99,7 +100,17 @@ export const useWithdrawalRequests = () => {
}),
contractRpc.getLastCheckpointIndex(),
]);
const requestStatuses = await contractRpc.getWithdrawalStatus(requestIds);

const STATUS_BATCH_SIZE = 500;
const requestStatuses: Awaited<
ReturnType<WithdrawalQueueAbi['getWithdrawalStatus']>
> = [];

for (let i = 0; i < requestIds.length; i += STATUS_BATCH_SIZE) {
const batch = requestIds.slice(i, i + STATUS_BATCH_SIZE);
const batchStatuses = await contractRpc.getWithdrawalStatus(batch);
requestStatuses.push(...batchStatuses);
}

const claimableRequests: RequestStatus[] = [];
const pendingRequests: RequestStatusPending[] = [];
Expand Down
Loading
Loading