Musicoin / go-musicoin

:link: Go-version of Musicoin blockchain wallet and consensus
GNU Lesser General Public License v3.0
162 stars 57 forks source link

Hardfork for MCIP-6 #80

Closed immartian closed 6 years ago

immartian commented 6 years ago

@trustfarm-dev @5chdn @seungjlee

5chdn commented 6 years ago

instructions in #79

the branch for testing is a5-fork-donotmerge

5chdn commented 6 years ago

Code is ready in GMC 2.6 and Parity 1.10 (to be merged), please proceed with the last 3 steps.

Fork number is 2222222

ghost commented 6 years ago

@5chdn Needs release for the fork 👍

immartian commented 6 years ago

@5chdn there's big issue with this version to use web3.js to access old contracts, please come to help, or it could be a disaster.

immartian commented 6 years ago

e.g.

const fs = require('fs');
const Web3 = require('web3');
const Web3Reader = require('./web3-reader');
const SolidityUtils = require("./solidity-utils");
const pppMvp2Abi = JSON.parse(fs.readFileSync(__dirname + '/../../solidity/mvp2/PayPerPlay.sol.abi'));
const artistAbi = JSON.parse(fs.readFileSync(__dirname + '/../../solidity/mvp7/Artist.sol.abi'));

  this.web3 = new Web3();
  this.web3.setProvider(new this.web3.providers.HttpProvider("http://localhost:8545"));
  this.web3Reader = new Web3Reader(this.web3);
var output;
this.web3Reader.getArtistByProfile("0xc46c6d80896ac3eb259cf478b90a655f887102d9",output);
console.log(output);
var cont;
cont = this.web3Reader.getContractAt(artistAbi,"0xc46c6d80896ac3eb259cf478b90a655f887102d9");

console.log(cont.artistName());

var artist;

//artist = this .web3Reader.getArtistContractInstance("0xc46c6d80896ac3eb259cf478b90a655f887102d9");
//console.log(artist.artistName());

would return nothing, but previously it works with gmc 2.5

immartian commented 6 years ago

not sure if eth.Contract methods changed in geth/web3, it simply return nothing from chain.

immartian commented 6 years ago

in console, both GMC 2.5 and 2.6 can load contract code(identical)

eth.getCode("0xc46c6d80896ac3eb259cf478b90a655f887102d9")

on both version (2.5 and 2.6) they return the contract code identically:


"0x60606040523615610145576000357c0100000000000000000000000000000000000000000000000000000000900480630221038a14610
1f257806313af4035146102185780632755cd2d146102355780632abff1f2146102445780632fc5a6e51461029f5780633a5673a4146102f
a57806345c840dd146103385780634d798a391461037657806351414b94146103f65780635b2f515b1461040a5780636049a45d1461048a5
780636665d99a146105ba57806374a5a41b146105d75780637865bc111461060a5780638da5cb5b1461061e578063a0a8e4601461065c578
063a433ccc7146106dc578063aba83150146106f0578063ac3e3d8d14610770578063b4837d9e14610798578063d1707551146107f357806
3dfea21df14610873578063e31e9c901461089b578063f09db170146108c3578063ff2543ea146108e057610145565b6101f05b600060036
0009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141
5156101ed57600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673fffffffffffffffffffffffffffff
fffffffffff166108fc349081150290604051809050600060405180830381858888f1935050505015156101ec575b5b5b565b005b3461000
257610216600480803590602001909190803590602001909190505061093b565b005b3461000257610233600480803590602001909190505.... ```

However, they behave differently when using 
> eth.contract(ABI).at("0xc46c6d80896ac3eb259cf478b90a655f887102d9") 
which 2.6 returns nothing. 
immartian commented 6 years ago

I've tried to use solc to regenerate a new ABI but still same result. No idea where's the compatibility issue came from.

immartian commented 6 years ago

not sure if it's related to https://github.com/ethereum/go-ethereum/pull/15285

immartian commented 6 years ago

After scrutinizing every aspect, the most probable reason could be the compatibility issue in solc which changed a lot in the passing months, which introduced a lot of ABI-related modifications. However, I still can't find which part is more relevant to this issue, even after trying to use the newest solc to compile abi from old version of .sol (Artist, PPP).

Not sure if we should roll back mere solidity part back to early versions. @5chdn

immartian commented 6 years ago

we have decided to roll back the most recent upstream to early version(https://github.com/Musicoin/go-musicoin/pull/87) will keep testing and close watching in the coming days.

immartian commented 6 years ago

88 pushed to reflect the bootnodes changes by @5chdn at #85

immartian commented 6 years ago

Parity 1.9+ won't sync with with GMC 2.6.x with it's newest spec. Wonder what EIPs should be switched off to make sure it's compatible with GMC 2.5.3 but keep 150,155 in place. @5chdn

Serpent6877 commented 6 years ago

Running GMC 2.6.2-beta-1d81d6eb after some serious issues with Parity and now seeing this in GMC log:

INFO [03-28|21:39:53] Commit new mining work number=2228990 txs=32 uncles=0 elapsed=47.139ms ERROR[03-28|21:40:01] ########## BAD BLOCK ######### Chain config: {ChainID: 7762959 Homestead: 1150000 MCIP3-UBI: 1200001 DAO: 36028797018963967 DAOSupport: false EIP150: 2222222 EIP155: 2222222 EIP158: 2222222 Byzantium: 2222222 Engine: ethash}

Number: 2222222 Hash: 0x1da5c1b193270b6d579ffd6130e73ec60d6c261a1a0f34e06ab751e9c08a3fa2

Error: invalid difficulty: have 9268327021398, want 9268325972822 ##############################

Continues to report this error every 5-10 blocks.

5chdn commented 6 years ago

That's normal. Just a warning.

Varunram commented 6 years ago

Closing since we hard forked successfully.

immartian commented 6 years ago

thanks all, it's a great team work.