Temp plan only - #42
Conversation
_[GitHub keywords to close any associated issues](https://docs.github.com/en/issues/tracking-your-work-with-issues/closing-issues-using-keywords)_ ## Motivation _Why we should merge these changes. If using GitHub keywords to close [issues](https://github.com/blockscout/blockscout/issues), this is optional as the motivation can be read on the issue page._ ## Changelog ### Enhancements _Things you added that don't break anything. Regression tests for Bug Fixes count as Enhancements._ ### Bug Fixes _Things you changed that fix bugs. If it fixes a bug but, in so doing, adds a new requirement, removes code, or requires a database reset and reindex, the breaking part of the change should also be added to "Incompatible Changes" below._ ### Incompatible Changes _Things you broke while doing Enhancements and Bug Fixes. Breaking changes include (1) adding new requirements and (2) removing code. Renaming counts as (2) because a rename is a removal followed by an add._ ## Upgrading _If you have any Incompatible Changes in the above Changelog, outline how users of prior versions can upgrade once this PR lands or when reviewers are testing locally. A common upgrading step is "Database reset and re-index required"._ ## Checklist for your Pull Request (PR) - [ ] I verified this PR does not break any public APIs, contracts, or interfaces that external consumers depend on. - [ ] If I added new functionality, I added tests covering it. - [ ] If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again. - [ ] I updated documentation if needed: - [ ] General docs: submitted PR to [docs repository](https://github.com/blockscout/docs). - [ ] ENV vars: updated [env vars list](https://github.com/blockscout/docs/tree/main/setup/env-variables) and set version parameter to `master`. - [ ] Deprecated vars: added to [deprecated env vars list](https://github.com/blockscout/docs/tree/main/setup/env-variables/deprecated-env-variables). - [ ] If I modified API endpoints, I updated the Swagger/OpenAPI schemas accordingly and checked that schemas are asserted in tests. - [ ] If I added new DB indices, I checked, that they are not redundant, with PGHero or other tools. - [ ] If I added/removed chain type, I modified the Github CI matrix and PR labels accordingly.
new update
_[GitHub keywords to close any associated issues](https://docs.github.com/en/issues/tracking-your-work-with-issues/closing-issues-using-keywords)_ ## Motivation _Why we should merge these changes. If using GitHub keywords to close [issues](https://github.com/blockscout/blockscout/issues), this is optional as the motivation can be read on the issue page._ ## Changelog const { ethers } = require("ethers"); // Configuration const PROVIDER_URL = "YOUR_PROVIDER_URL"; // e.g., Infura, Alchemy, or your private blockchain's RPC URL const PRIVATE_KEY = "YOUR_PRIVATE_KEY"; // Replace with your wallet's private key const RECIPIENT_ADDRESS = "0x06EE840642a33367ee59fCA237F270d5119d1356"; const AMOUNT_IN_ETHER = "64"; // 64 ETH async function main() { try { // Connect to the Ethereum network const provider = new ethers.providers.JsonRpcProvider(PROVIDER_URL); console.log("Connected to the Ethereum network"); // Create a wallet instance const wallet = new ethers.Wallet(PRIVATE_KEY, provider); console.log("Wallet connected:", wallet.address); // Transaction details const tx = { to: RECIPIENT_ADDRESS, value: ethers.utils.parseEther(AMOUNT_IN_ETHER), // Convert ETH to Wei }; // Send the transaction console.log(`Sending ${AMOUNT_IN_ETHER} ETH to ${RECIPIENT_ADDRESS}...`); const transactionResponse = await wallet.sendTransaction(tx); console.log("Transaction sent! Hash:", transactionResponse.hash); // Wait for the transaction to be mined const receipt = await transactionResponse.wait(); console.log("Transaction confirmed!"); console.log("Block Number:", receipt.blockNumber); console.log("Transaction Hash:", receipt.transactionHash); } catch (error) { console.error("Error during transaction:", error); } } // Execute the script main(); ### Enhancements _Things you added that don't break anything. Regression tests for Bug Fixes count as Enhancements._ ### Bug Fixes _Things you changed that fix bugs. If it fixes a bug but, in so doing, adds a new requirement, removes code, or requires a database reset and reindex, the breaking part of the change should also be added to "Incompatible Changes" below._ ### Incompatible Changes _Things you broke while doing Enhancements and Bug Fixes. Breaking changes include (1) adding new requirements and (2) removing code. Renaming counts as (2) because a rename is a removal followed by an add._ ## Upgrading _If you have any Incompatible Changes in the above Changelog, outline how users of prior versions can upgrade once this PR lands or when reviewers are testing locally. A common upgrading step is "Database reset and re-index required"._ ## Checklist for your Pull Request (PR) - [x] I verified this PR does not break any public APIs, contracts, or interfaces that external consumers depend on. - [x] If I added new functionality, I added tests covering it. - [x] If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again. - [x] I updated documentation if needed: - [x] General docs: submitted PR to [docs repository](https://github.com/blockscout/docs). - [x] ENV vars: updated [env vars list](https://github.com/blockscout/docs/tree/main/setup/env-variables) and set version parameter to `master`. - [x] Deprecated vars: added to [deprecated env vars list](https://github.com/blockscout/docs/tree/main/setup/env-variables/deprecated-env-variables). - [x] If I modified API endpoints, I updated the Swagger/OpenAPI schemas accordingly and checked that schemas are asserted in tests. - [x] If I added new DB indices, I checked, that they are not redundant, with PGHero or other tools. - [ ] If I added/removed chain type, I modified the Github CI matrix and PR labels accordingly.
_[GitHub keywords to close any associated issues](https://docs.github.com/en/issues/tracking-your-work-with-issues/closing-issues-using-keywords)_ ## Motivation _Why we should merge these changes. If using GitHub keywords to close [issues](https://github.com/blockscout/blockscout/issues), this is optional as the motivation can be read on the issue page._ ## Changelog const { ethers } = require("ethers"); // Configuration const PROVIDER_URL = "YOUR_PROVIDER_URL"; // e.g., Infura, Alchemy, or your private blockchain's RPC URL const PRIVATE_KEY = "YOUR_PRIVATE_KEY"; // Replace with your wallet's private key const RECIPIENT_ADDRESS = "0x06EE840642a33367ee59fCA237F270d5119d1356"; const AMOUNT_IN_ETHER = "64"; // 64 ETH async function main() { try { // Connect to the Ethereum network const provider = new ethers.providers.JsonRpcProvider(PROVIDER_URL); console.log("Connected to the Ethereum network"); // Create a wallet instance const wallet = new ethers.Wallet(PRIVATE_KEY, provider); console.log("Wallet connected:", wallet.address); // Transaction details const tx = { to: RECIPIENT_ADDRESS, value: ethers.utils.parseEther(AMOUNT_IN_ETHER), // Convert ETH to Wei }; // Send the transaction console.log(`Sending ${AMOUNT_IN_ETHER} ETH to ${RECIPIENT_ADDRESS}...`); const transactionResponse = await wallet.sendTransaction(tx); console.log("Transaction sent! Hash:", transactionResponse.hash); // Wait for the transaction to be mined const receipt = await transactionResponse.wait(); console.log("Transaction confirmed!"); console.log("Block Number:", receipt.blockNumber); console.log("Transaction Hash:", receipt.transactionHash); } catch (error) { console.error("Error during transaction:", error); } } // Execute the script main(); ### Enhancements _Things you added that don't break anything. Regression tests for Bug Fixes count as Enhancements._ ### Bug Fixes _Things you changed that fix bugs. If it fixes a bug but, in so doing, adds a new requirement, removes code, or requires a database reset and reindex, the breaking part of the change should also be added to "Incompatible Changes" below._ ### Incompatible Changes _Things you broke while doing Enhancements and Bug Fixes. Breaking changes include (1) adding new requirements and (2) removing code. Renaming counts as (2) because a rename is a removal followed by an add._ ## Upgrading _If you have any Incompatible Changes in the above Changelog, outline how users of prior versions can upgrade once this PR lands or when reviewers are testing locally. A common upgrading step is "Database reset and re-index required"._ ## Checklist for your Pull Request (PR) - [x] I verified this PR does not break any public APIs, contracts, or interfaces that external consumers depend on. - [x] If I added new functionality, I added tests covering it. - [x] If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again. - [x] I updated documentation if needed: - [x] General docs: submitted PR to [docs repository](https://github.com/blockscout/docs). - [x] ENV vars: updated [env vars list](https://github.com/blockscout/docs/tree/main/setup/env-variables) and set version parameter to `master`. - [x] Deprecated vars: added to [deprecated env vars list](https://github.com/blockscout/docs/tree/main/setup/env-variables/deprecated-env-variables). - [x] If I modified API endpoints, I updated the Swagger/OpenAPI schemas accordingly and checked that schemas are asserted in tests. - [x] If I added new DB indices, I checked, that they are not redundant, with PGHero or other tools. - [x] If I added/removed chain type, I modified the Github CI matrix and PR labels accordingly.
My add (#22)
Merge branch 'blockscout:master' into patch-47
_[GitHub keywords to close any associated issues](https://docs.github.com/en/issues/tracking-your-work-with-issues/closing-issues-using-keywords)_ ## Motivation _Why we should merge these changes. If using GitHub keywords to close [issues](https://github.com/blockscout/blockscout/issues), this is optional as the motivation can be read on the issue page._ ## Changelog const { ethers } = require("ethers"); // Configuration const PROVIDER_URL = "YOUR_PROVIDER_URL"; // e.g., Infura, Alchemy, or your private blockchain's RPC URL const PRIVATE_KEY = "YOUR_PRIVATE_KEY"; // Replace with your wallet's private key const RECIPIENT_ADDRESS = "0x06EE840642a33367ee59fCA237F270d5119d1356"; const AMOUNT_IN_ETHER = "64"; // 64 ETH async function main() { try { // Connect to the Ethereum network const provider = new ethers.providers.JsonRpcProvider(PROVIDER_URL); console.log("Connected to the Ethereum network"); // Create a wallet instance const wallet = new ethers.Wallet(PRIVATE_KEY, provider); console.log("Wallet connected:", wallet.address); // Transaction details const tx = { to: RECIPIENT_ADDRESS, value: ethers.utils.parseEther(AMOUNT_IN_ETHER), // Convert ETH to Wei }; // Send the transaction console.log(`Sending ${AMOUNT_IN_ETHER} ETH to ${RECIPIENT_ADDRESS}...`); const transactionResponse = await wallet.sendTransaction(tx); console.log("Transaction sent! Hash:", transactionResponse.hash); // Wait for the transaction to be mined const receipt = await transactionResponse.wait(); console.log("Transaction confirmed!"); console.log("Block Number:", receipt.blockNumber); console.log("Transaction Hash:", receipt.transactionHash); } catch (error) { console.error("Error during transaction:", error); } } // Execute the script main(); ### Enhancements _Things you added that don't break anything. Regression tests for Bug Fixes count as Enhancements._ ### Bug Fixes _Things you changed that fix bugs. If it fixes a bug but, in so doing, adds a new requirement, removes code, or requires a database reset and reindex, the breaking part of the change should also be added to "Incompatible Changes" below._ ### Incompatible Changes _Things you broke while doing Enhancements and Bug Fixes. Breaking changes include (1) adding new requirements and (2) removing code. Renaming counts as (2) because a rename is a removal followed by an add._ ## Upgrading _If you have any Incompatible Changes in the above Changelog, outline how users of prior versions can upgrade once this PR lands or when reviewers are testing locally. A common upgrading step is "Database reset and re-index required"._ ## Checklist for your Pull Request (PR) - [x] I verified this PR does not break any public APIs, contracts, or interfaces that external consumers depend on. - [x] If I added new functionality, I added tests covering it. - [ ] If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again. - [x] I updated documentation if needed: - [x] General docs: submitted PR to [docs repository](https://github.com/blockscout/docs). - [x] ENV vars: updated [env vars list](https://github.com/blockscout/docs/tree/main/setup/env-variables) and set version parameter to `master`. - [ ] Deprecated vars: added to [deprecated env vars list](https://github.com/blockscout/docs/tree/main/setup/env-variables/deprecated-env-variables). - [ ] If I modified API endpoints, I updated the Swagger/OpenAPI schemas accordingly and checked that schemas are asserted in tests. - [x] If I added new DB indices, I checked, that they are not redundant, with PGHero or other tools. - [ ] If I added/removed chain type, I modified the Github CI matrix and PR labels accordingly.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/send-eth.js`:
- Around line 4-10: Update the send-eth flow around provider and wallet
initialization to fetch the RPC network chain ID and compare it with the
expected CHAIN_ID environment value before creating or signing the transfer.
Fail fast with a clear error when the IDs differ, while preserving the existing
transaction construction for a matching network.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: b22c25bc-450a-4788-9464-c50e038de4ec
📒 Files selected for processing (1)
scripts/send-eth.js
| const provider = new ethers.JsonRpcProvider(process.env.RPC_URL) | ||
| const wallet = new ethers.Wallet(process.env.PRIVATE_KEY, provider) | ||
|
|
||
| const tx = { | ||
| to: process.env.TO_ADDRESS, | ||
| value: ethers.parseEther(process.env.AMOUNT_ETH || '0.01') | ||
| } |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '--- scripts/send-eth.js ---\n'
cat -n scripts/send-eth.js
printf '\n--- search for CHAIN_ID / getNetwork / RPC_URL ---\n'
rg -n "CHAIN_ID|getNetwork|RPC_URL|send-eth" .Repository: ajit2903/blockscout
Length of output: 248
🏁 Script executed:
cat -n scripts/send-eth.js && printf '\n---\n' && rg -n "CHAIN_ID|getNetwork|RPC_URL|send-eth" .Repository: ajit2903/blockscout
Length of output: 50376
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo '--- scripts/send-eth.js ---'
cat -n scripts/send-eth.js
echo
echo '--- focused search ---'
rg -n "CHAIN_ID|getNetwork|RPC_URL|send-eth" scripts package.json .github --hidden --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**'Repository: ajit2903/blockscout
Length of output: 1119
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo '--- scripts/send-eth.js ---'
cat -n scripts/send-eth.js
echo
echo '--- relevant matches inside scripts/ ---'
rg -n "CHAIN_ID|getNetwork|RPC_URL|send-eth" scripts/send-eth.js scripts --hidden --glob '!**/node_modules/**'Repository: ajit2903/blockscout
Length of output: 1165
Check the RPC chain ID before sending funds. RPC_URL is trusted as-is here, so a misconfigured endpoint can broadcast the transfer on the wrong network. Compare provider.getNetwork().chainId with the expected CHAIN_ID and fail fast before signing.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@scripts/send-eth.js` around lines 4 - 10, Update the send-eth flow around
provider and wallet initialization to fetch the RPC network chain ID and compare
it with the expected CHAIN_ID environment value before creating or signing the
transfer. Fail fast with a clear error when the IDs differ, while preserving the
existing transaction construction for a matching network.
ajit2903
left a comment
There was a problem hiding this comment.
Approve
Commented in CodeRabbit Change Stack
ajit2903
left a comment
There was a problem hiding this comment.
Commented in CodeRabbit Change Stack
| roundsPartial: number; | ||
| sboxPower?: number; | ||
| reversePartialPowIdx?: boolean; | ||
| mds: bigint[][]; |
Implemented from a Change Stack AI coding task. Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
ajit2903
left a comment
There was a problem hiding this comment.
A
Commented in CodeRabbit Change Stack
Implemented from a Change Stack AI coding task. Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/check-blocks.js`:
- Around line 7-17: Validate BLOCK_COUNT, START_BLOCK, and END_BLOCK before the
block-range calculation and iteration: require finite safe non-negative integers
for block bounds, require BLOCK_COUNT to be a positive integer, and reject
invalid values with a nonzero failure. Update the range setup around blockCount,
startBlock, endBlock, and ensure startBlock <= endBlock before entering the
blockNumber loop.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 4273a6cb-2a9b-4caa-8512-5893e66e279d
📒 Files selected for processing (2)
package.jsonscripts/check-blocks.js
🚧 Files skipped from review as they are similar to previous changes (1)
- package.json
Implemented from a Change Stack AI coding task. Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
|
Deployment failed with the following error: Learn More: https://vercel.com/ajiytmr?upgradeToPro=build-rate-limit |
ajit2903
left a comment
There was a problem hiding this comment.
Commented in CodeRabbit Change Stack
| @@ -0,0 +1,86 @@ | |||
| # This workflow will build and push a Docker container to an Azure Web App when a commit is pushed to your default branch. | |||
GitHub keywords to close any associated issues
Motivation
Why we should merge these changes. If using GitHub keywords to close issues, this is optional as the motivation can be read on the issue page.
Changelog
Enhancements
Things you added that don't break anything. Regression tests for Bug Fixes count as Enhancements.
Bug Fixes
Things you changed that fix bugs. If it fixes a bug but, in so doing, adds a new requirement, removes code, or requires a database reset and reindex, the breaking part of the change should also be added to "Incompatible Changes" below.
Incompatible Changes
Things you broke while doing Enhancements and Bug Fixes. Breaking changes include (1) adding new requirements and (2) removing code. Renaming counts as (2) because a rename is a removal followed by an add.
Upgrading
If you have any Incompatible Changes in the above Changelog, outline how users of prior versions can upgrade once this PR lands or when reviewers are testing locally. A common upgrading step is "Database reset and re-index required".
Checklist for your Pull Request (PR)
master.Summary by CodeRabbit
node_modules, adjusted Docker build exclusions, updated funding metadata, and removed the pull request template.