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
0 answers
15 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
28 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
40 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
87 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
15 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
107 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
1 vote
1 answer
12 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
0 votes
0 answers
165 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
147 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
375 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
  • 253
0 votes
0 answers
12 views

Forking Ethereum Blockchain to run a blockchain at your mainnet

I want to fork Ethereum blockchain and after forking the chain i want to set up my nodes network, And want to rebrand it and want to live the chain and want to run it on EVM
Abubakar Mujahid's user avatar
1 vote
1 answer
417 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
  • 253
0 votes
1 answer
34 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
  • 317
2 votes
1 answer
471 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
94 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
68 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
232 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
  • 135
1 vote
0 answers
32 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
1 answer
273 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
189 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
302 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
323 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
147 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
45 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
11 votes
9 answers
11k 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
467 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
101 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
3 answers
5k 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
381 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
829 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
  • 292
4 votes
1 answer
763 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 ...
typeduke's user avatar
  • 145
0 votes
1 answer
463 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
667 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
95 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
94 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
452 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,670
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
178 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
90 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
27 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
433 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
937 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,670
0 votes
2 answers
122 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
2 votes
1 answer
112 views

What is the Muir Glacier hardfork?

What is the Muir Glacier hardfork on the Ethereum mainnet?
Shane Fontaine's user avatar
3 votes
1 answer
1k views

How to fork current eth mainnet chain in new private blockchain from block #####

I want to run my own eth fork from mainnet (keeping history of transactions, balances & etc). How can I start my new geth instance that will start working after ###### block of mainnet chain? I ...
g_arc's user avatar
  • 31