Skip to main content

Questions tagged [forks]

forks are events where the blockchain consensus is not guaranteed and clients may have different states

Filter by
Sorted by
Tagged with
0 votes
1 answer
24 views

Is PoW an indispensable component in blockchain?

There is an argument that if the Proof-of-Work (PoW) mechanism is removed from the Bitcoin network or if the puzzle does not have a sufficient level of difficulty proportional to the computing power ...
Questioner's user avatar
  • 2,680
0 votes
1 answer
30 views

Error in Fork Testing

I ran the test: forge test --fork-url $SEPOLIA_RPC_URL and this error was returned: error: a value is required for '--fork-url <URL>' but none was supplied. // SPDX-License-Identifier: MIT /...
Kwesili Okafor's user avatar
0 votes
1 answer
118 views

"Error HH604: Troubleshooting 'missing trie node' issue when forking BSC mainnet using Hardhat

I encountered an issue while attempting to fork the Binance Smart Chain (BSC) mainnet using Hardhat. Here's the command I used: npx hardhat node --fork https://bsc-dataseed1.defibit.io/ However, I ...
adam mr's user avatar
  • 131
0 votes
0 answers
40 views

Mainnet-fork has different result than mainnet

I'm currently forking Binance Smart Chain using Brownie and Python. The idea is to use the forked network to test if new BEP20 tokens can be traded (buy and sell) using pancakeswap, and check if the ...
BJ2M's user avatar
  • 11
0 votes
1 answer
245 views

How to run the hardhat fork in the separate terminal?

I want to interact with the contracts in the mainnet, i used hardhat fork to fork the arbitrum mainnet, forking is done but after that my contracts getting deployed according to the script and the ...
Aviroxi's user avatar
0 votes
2 answers
145 views

How to call public view functions from Contract in a local hardhat node forking a public network?

I have a Hardhat project with a sample storage contract. There are 2 functions: Public view function Public write function (creates a transaction) My Hardhat project forks an Ethereum mainnet public ...
Alexander Herranz's user avatar
2 votes
0 answers
189 views

Hardhat public network fork: Error calling view functions with ethers.js on browser

I have my hardhat network configured as a fork of Binance Smart Chain like this: const config: HardhatUserConfig = { solidity: { version: "0.8.0", settings: { optimizer: { ...
Alexander Herranz's user avatar
1 vote
0 answers
20 views

Mainnet fork deployment - Error: *** Deployment Failed *** "Migrations" hit an invalid opcode while deploying

I am trying to deploy contracts on a mainnet fork. I have my fork running with the command ganache --fork https://mainnet.infura.io/v3/$INFURA_API_KEY --wallet.unlockedAccounts=$MY_ACCOUNT --chain....
justinsacco's user avatar
0 votes
0 answers
161 views

How to calculate the Max Buy and max sell of an erc20 token even without liquidity

How to calculate the Max Buy and max sell of an erc20 token even without liquidity. There are many Ethereum tokens with a limit to the maximum amount of tokens that can be bought at once and sold. I ...
JoachimScript's user avatar
2 votes
1 answer
30 views

Attestation on fork or reorg

Suppose a validator needs to do attestation for slot N. It sends the attestation but later discovers that there was a fork or reorg on slot N-1 (and that he attested for the wrong fork). Should he ...
Matheus Franco's user avatar
2 votes
0 answers
456 views

Error HH604: Error running JSON-RPC server: Connect Timeout Error

I'm facing an error while running the command "yarn hardhat node" ERROR: Error HH604: Error running JSON-RPC server: Connect Timeout Error For more info go to https://hardhat.org/HH604 or ...
PsychoPunk_Sage's user avatar
1 vote
1 answer
235 views

When did each opcode get added to the EVM?

After the original set defined in the Ethereum yellow paper, many new opcodes have been added. I'm after a list of when each one was added (by fork).
bguiz's user avatar
  • 225
0 votes
1 answer
860 views

Using hardhat to fork a node but getting 'Missing Trie Node'

Im using hardhat to fork a node in the command line. cmd> npx hardhat node --fork https://therpcnodehere.com After about 10 minutes or so the fork starts responding to requests with 'missing trie ...
CathalMF's user avatar
  • 283
1 vote
1 answer
673 views

hardhat fork of private network with zero gas fees still requires a balance to perform a transaction

I forked my private network in hardhat using the below hardhat.config.js My network gas zero gas fees so we dont have any balances. module.exports = { networks: { hardhat: { ...
CathalMF's user avatar
  • 283
0 votes
1 answer
39 views

Why would Ethereum forks chose different Bip39 Derivation paths derivation path than ethereum?

Just wondering why Ethereum forks like Ethereum Classic or others would chose a different derivation path than Ethereum? Having the same derivation path would guaranty greater support as it would be ...
Kevin Wad's user avatar
  • 327
2 votes
1 answer
686 views

How to calculate max buy and sell amounts of a token?

There are some contracts on the ethereum blockchain (like this one) that has either predefined max buy and sell amounts and/or function for setting max buy and sell percent/amount etc. I am trying to ...
Tugay's user avatar
  • 125
0 votes
0 answers
115 views

Solidity assembly function returns false on forked blockchain

I try to simulate submitting transaction to Multisig contract and confirming transaction by other multisig members by impersonating their account on Hardhat with forking. I managed submitting and ...
Sergen's user avatar
  • 1
4 votes
1 answer
95 views

Network partitioning and FINALITY

Imagine China has switched the internet off. Half validators are in the China, half in the rest of the world. So we have a 2 separate networks (like a fork). Each side produces some blocks and votes ...
YodaDefi's user avatar
1 vote
1 answer
362 views

Hardhat: Detect script is running on forked network

I want to detect in my JS script that the code is running against a forked network, and therefore run conditional code based on this. In hardhat.config.js I have added to networks: networks: { ...
pho_pho's user avatar
  • 157
1 vote
0 answers
33 views

Fork of geth - activate mining ONLY when there's transaction(s) that've come from a certain wallet/address. How?

This may be a fork of geth, or any other node client, or a tweak in its functionality: I want to be able to activate mining process only when, and if, there have come transaction(s) from a certain ...
Kum's user avatar
  • 75
1 vote
2 answers
432 views

Forking the chain locally

I would like to fork the ETH chain and play around with it locally, maybe even buy a few raspberry pi's and run some nodes just to present it visually. Can someone please point me to some ...
AvocadoChocolate's user avatar
1 vote
0 answers
201 views

Can not deploy my contract on ganache-cli using ETH mainnet fork

I used ganache-cli in combination with my Infura key to fork ETH mainnet so I could use the Uniswap router in my development environment: ganache-cli --fork https://mainnet.infura.io/v3/<mykeyhere&...
Arjun Reddy's user avatar
2 votes
1 answer
325 views

What happens to NFTs when the blockchain is forked?

When the blockchain underlying a cryptocurrency is forked, both the ownership status of all the currency is cloned, and everyone possesses the coins they had on the original blockchain then on both ...
Dakkaron's user avatar
  • 121
0 votes
1 answer
352 views

Brownie contract Interface not working on mainnet-fork

I'm following Patric Collins youtube video and trying to deposit wETH in the wETH contract using an interface and working using a fork of mainnet. I am trying to deposit eth in the next contract. ...
ericgc1997's user avatar
1 vote
0 answers
11 views

How are updates rolled out?

if an update to Ethereum or any other cryptocurrency is rolled out, how to ensure that everyone in the network is running the same 'version'. Especially if the update is not backward-compatible with ...
Nerox's user avatar
  • 11
0 votes
1 answer
155 views

I can't set the limit that the contract accumulates tokens to exchange for BNB

My contract is a safemoon fork. He must tax transactions, accumulate some tokens and sell these tokens by BNB to send to the 4 wallets in the code. Turns out he must sell the tokens when he hits a ...
Ether Man's user avatar
1 vote
0 answers
49 views

Spin up custom ETH based blockchain: just changing the genesis and toml?

If I wanted, lets say, to power on a clone of BSC (just to have a PoA version of the thing), would it be enough to follow the full node setup guide from Binance and just edit the config.toml and the ...
Wyatt Gillette's user avatar
3 votes
1 answer
2k views

Does anyone know how to fork a chain at a particular block on Brownie?

I am trying to fork the ethereum mainnet at a past block number on brownie. But I dont see any way to do that in the brownie docs .
Diganta Kalita's user avatar
12 votes
9 answers
12k views

Invalid value undefined for HardhatConfig.networks.mainnet_fork.url - Expected a value of type string

I have an ALCHEMY_MAINNET_RPC_URL environment that is of type string. I can verify it as such with: const ALCHEMY_MAINNET_RPC_URL = process.env.ALCHEMY_MAINNET_RPC_URL || '' console.log(typeof (...
Patrick Collins's user avatar
2 votes
0 answers
525 views

Listen for Reorganized Blocks using Web3js

Assuming there is a reorganization at block height N, the block with hash H being the forked block and H' the block that is the 'actual' one. 1. Will web3.eth.subscribe('newBlockHeaders' \[, callback\]...
l30c0d35's user avatar
1 vote
1 answer
115 views

How common are orphaned blocks on Ethereum?

How often do orphaned blocks happen on Ethereum? I have read about the 3000 orphaned chain of block on Ethereum Classic, what has been the longest orphaned chain on Ethereum?
Barney Chambers's user avatar
12 votes
4 answers
6k views

hardhat mainnet forking and impersonating an account isnt working, help!

So I'm trying to fork the mainnet using hardhat, impersonate a Dai whale, and transfer its Dai to a hardhat wallet for testing a smart contract, but I'm running into problems. My code looks like this: ...
Nolan Jannotta's user avatar
1 vote
1 answer
408 views

Uniswap Fork: Able to add liquidity, but not able to swap

I am forking uniswap and deploying it on Rinkbey TestNet. I have successfully deployed factory, router, weth contracts. I have replaced the respective addresses in the uniswap interface code. I ...
Amalnath Sathyan's user avatar
0 votes
1 answer
899 views

How to fork the mainnet

I'm pretty new to Ethereum. I'm trying to write a simple dapp, which can deposit and withdrawal from aave. In order to communicate create the contract first I need to fork the mainnet. I'm not exactly ...
johnny 5's user avatar
  • 310
4 votes
1 answer
845 views

How many blocks were reversed with the DAO hard fork?

There are some facts regarding the DAO hack and the subsequent hard fork that can be found everywhere, e.g., that the hard fork happened at block height 1,920,000, that it was undertaken in an effort ...
lkbaerenfaenger's user avatar
0 votes
1 answer
488 views

How do uncle blocks remain valid?

Even though Ethereum does not directly use GHOST, stale blocks can be included as uncles for a reward. How can uncle blocks remain valid, as I suppose state transitions must be non-conflicting? The ...
Marcellvs's user avatar
  • 423
0 votes
0 answers
20 views

Could we fork Ethereum and make Ether ERC-20 compliant?

Is it possible for some future fork to make Ethereum ERC-20 compliant? Since ERC-20 didn't exist at the beginning of Ethereum, I'm curious if it would be beneficial for Ether to interact more directly ...
tjr226's user avatar
  • 241
4 votes
3 answers
1k views

Uniswap Router deployment error: "UniswapV2Router02" -- Cannot create instance of UniswapV2Router02; no code at address 0xxxxxxxxx

I am trying to fork Uniswap and deploy on Ropsten testnet for educational and testing purposes. From what I gathered, it seems that we need to first deploy the UniswapV2Factory contract, followed by ...
daQuincy's user avatar
0 votes
0 answers
669 views

When forking MainNet with ganache-cli and trying to interact with contract -> error thrown

Forked MainNet with Ganache-ClI wrote script to interact with on-chain DAI contract to send some Dai to account Unlocked the DAI contract const Web3 = require('web3'); const daiAbi = require('/Users/...
GreyShadow94's user avatar
2 votes
1 answer
96 views

Which fork implemented EIP-141? (invalid opcode)

EIP-141 https://eips.ethereum.org/EIPS/eip-141 was introduced in 2017, but I cannot find it in any of the meta lists for forks https://eips.ethereum.org/meta. Is there a fork under which it was ...
Peteris's user avatar
  • 1,005
2 votes
1 answer
103 views

How would a 50/50 netsplit play out on Ethereum 2 (beaconchain)?

I'd like to know what would happen in terms of penalization of staked validators if there was some sort of major global netsplit that -- for the sake of this question -- resulted in exactly 50% of all ...
Joseph's user avatar
  • 123
2 votes
1 answer
2k views

HardHat deploy script works on testnet but not on forked hardhat network

The error that I am getting when running this is: Error: Invalid RpcBlockWithTransactions or null I have a contract called PriceConsumerV3 and it makes a view function call on a contract. I am ...
Patrick Collins's user avatar
2 votes
1 answer
526 views

Fork in Proof-of-Stake?

Regarding the fact that in Proof-of-Stake, a stakeholder will be elected randomly as the next author of the next block in each epoch (or each round or slot), logically, in each round (or slot) there ...
Questioner's user avatar
  • 2,680
1 vote
1 answer
51 views

What is the criteria to resync chain using proof of stake?

In PoW, nodes always resync their own chain to the longest chain in the network in order to respect the work the miners have done. In PoS, as I understand in its simplest form, the miner with the ...
Hang Chen's user avatar
  • 111
3 votes
0 answers
183 views

When running a geth node, how can I know when reorg occur?

I want to add a script to notify the dev team if re-org bigger than 200 blocks took place. How can I achieve it?
user3652172's user avatar
0 votes
1 answer
101 views

How can i create more that one node for test purposes?

I really need to have more than one node to test my smart contract. I'm using remix and i also installed ganache, however, ganache doesn't allow me to have more than one node as I hoped for... I have ...
martasaparicio's user avatar
1 vote
0 answers
28 views

Cost of forking Augur

Augur Version 2 is scheduled for launch on July 28th 2020. How can the cost of forking Augur version 2 (by disputing a market resolution) be calculated in REP? How dies this cost compare to the cost ...
user61639's user avatar
0 votes
0 answers
447 views

gas estimation about tests on Ganache forked mainnet

I come up with this solution with gas estimation. Could someone help check whether it is feasible? If we want to send a transaction, first, we just fork the newest mainnet blockchain using ganache-...
chunmiao's user avatar
4 votes
1 answer
1k views

Fork Choice Rule in Ethereum 2.0?

According to the "Fork choice rule" in Ethereum 2.0 (sharding), how to choose a branch in a fork? (A) or (B) ? (A) branch, which has the most blocks in it. (similar to "longest chain" rule in PoW)...
Questioner's user avatar
  • 2,680
0 votes
2 answers
124 views

Could smart contract use a fork block?

If generated two forked block A and B. Can the smart contract in block A access to transaction in block B? I know that PoS is consensus algorithm working by check all stake in block. The verifier ...
rapael's user avatar
  • 1