peut tu implementer une mise à l'echelle dynamique du blockrange ? En fonction du nombre…
- User
peut tu implementer une mise à l'echelle dynamique du blockrange ?
En fonction du nombre de txs trouvés, augmente ou reduit sa taille.
async getTransactions(limit: number, offset: number): Promise<Hash[]> {
if (limit <= 0) {
return [];
}
const count = limit;
const latestBlockNumber = await getBlockNumber(this.client.rpcClient);
const foundHashes: Hash[] = [];
const BLOCK_CHUNK_SIZE = 2000n;
let currentBlock = latestBlockNumber;
while (foundHashes.length < count && currentBlock >= 0n) {
const fromBlock = bigIntMax(0n, currentBlock - BLOCK_CHUNK_SIZE + 1n);
const toBlock = currentBlock;
const paramsBase = {
fromBlock: numberToHex(fromBlock),
toBlock: numberToHex(toBlock),
};
const [outgoingTraces, incomingTraces] = await Promise.all([
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.