Skip to content

Commit

Permalink
Merge pull request #478 from lidofinance/develop
Browse files Browse the repository at this point in the history
Merge develop to main
  • Loading branch information
Jeday authored Sep 19, 2024
2 parents 12558c8 + a0c3e22 commit 66c44aa
Show file tree
Hide file tree
Showing 20 changed files with 414 additions and 261 deletions.
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

0 comments on commit 66c44aa

Please sign in to comment.