Was war der erste Block, der mit Homestead abgebaut wurde?

Was war der erste abgebaute Homestead-Block?

1.150.000 waren geplant, kann das jemand bestätigen? https://ethereum.stackexchange.com/a/1834/264

Kann man sehen, dass es sich um einen Gehöftblock bei einem Grundstück handelt? https://etherchain.org/block/1150000

Antworten (1)

Antwort auf deine erste Frage

1.150.000.

Von Go Ethereum - params/util.go :

var (
    TestNetHomesteadBlock = big.NewInt(494000)  // testnet homestead block
    MainNetHomesteadBlock = big.NewInt(1150000) // mainnet homestead block
)


Antwort auf deine zweite Frage

Gehöft-Schwierigkeitsanpassung

Sie können versuchen, die Änderungen des Schwierigkeitsanpassungsalgorithmus ab dem Homestead-Block zu überprüfen. Aus EIP 2 :

  1. Ändern Sie den Schwierigkeitsanpassungsalgorithmus von der aktuellen Formel:

    block_diff = parent_diff + parent_diff // 2048 *
      (1 if block_timestamp - parent_timestamp < 13 else -1) + 
      int(2**((block.number // 100000) - 2))
    

    (wobei das + int(2**((block.number // 100000) - 2))die exponentielle Schwierigkeitsanpassungskomponente darstellt)

    zu

    block_diff = parent_diff + parent_diff // 2048 * 
      max(1 - (block_timestamp - parent_timestamp) // 10, -99) + 
      int(2**((block.number // 100000) - 2))
    

    , wobei // der ganzzahlige Divisionsoperator ist, z. 6 // 2 = 3, 7 // 2 = 3, 8 // 2 = 4.

    Das minDifficultyStandbild definiert die zulässige Mindestschwierigkeit und darf durch keine Anpassung unterschritten werden.


Änderung der Gaskosten bei Vertragserstellung

Sie können auch nach einer Vertragserstellungstransaktion suchen, bei der die Gaskosten von 21.000 auf 53.000 gestiegen sind. Von EIP 2 :

  1. Die Gaskosten für das Erstellen von Verträgen über eine Transaktion werden von 21.000 auf 53.000 erhöht, dh. Wenn Sie eine Transaktion senden und die Empfängeradresse eine leere Zeichenfolge ist, beträgt das anfänglich abgezogene Gas 53000 plus die Gaskosten der tx-Daten, anstatt 21000, wie es derzeit der Fall ist. Die Vertragserstellung aus einem Vertrag unter Verwendung des CREATE-Opcodes ist davon nicht betroffen.



Testen für die Anpassungsänderung der Homestead-Schwierigkeit

Ich habe den folgenden gethJavaScript-Code verwendet, um zu testen, ob die berechnete Schwierigkeit mit der Frontier-Formel oder der Homestead-Formel übereinstimmt:

function testDifficultyAdjustment(fromBlock, toBlock) {
  var i;

  for (i = fromBlock; i <= toBlock; i++) {
    var parentBlock = eth.getBlock(i-1);
    var thisBlock = eth.getBlock(i);

    var frontierDiffAdj = parseInt(parentBlock.difficulty) + parseInt(Math.floor(parentBlock.difficulty / 2048)) * ((thisBlock.timestamp - parentBlock.timestamp) < 13 ? 1 : -1) + Math.pow(2, (Math.floor(i / 100000) - 2));
    var frontierMatches = (thisBlock.difficulty == frontierDiffAdj) ? " = " : "<> ";

    var homesteadDiffAdj = parseInt(parentBlock.difficulty) + parseInt(Math.floor(parentBlock.difficulty / 2048)) * Math.max(1 - Math.floor((thisBlock.timestamp - parentBlock.timestamp)/10), -99) + Math.pow(2, (Math.floor(i / 100000) - 2));
    var homesteadMatches = (thisBlock.difficulty == homesteadDiffAdj) ? " = " : "<> ";

    console.log("#" + i + " Act: " + thisBlock.difficulty + " Front.: " + frontierMatches + frontierDiffAdj + " Home.: " + homesteadMatches + homesteadDiffAdj);
  }
}

testDifficultyAdjustment(1149980, 1150020);

Und hier sind die Ergebnisse – die Frontier-Formel entspricht < 1150000 und die Homestead-Formel entspricht >= 1150000:

#1149980 Act: 20463191314070 Front.:  = 20463191314070 Home.: <> 20413207944965
#1149981 Act: 20473183107215 Front.:  = 20473183107215 Home.: <> 20463191314582
#1149982 Act: 20463186436288 Front.:  = 20463186436288 Home.: <> 20443193093410
#1149983 Act: 20453194646548 Front.:  = 20453194646548 Home.:  = 20453194646548
#1149984 Act: 20443207735612 Front.:  = 20443207735612 Home.:  = 20443207735612
#1149985 Act: 20453189771151 Front.:  = 20453189771151 Home.:  = 20453189771151
#1149986 Act: 20463176680730 Front.:  = 20463176680730 Home.:  = 20463176680730
#1149987 Act: 20453184895754 Front.:  = 20453184895754 Home.: <> 20443193110266
#1149988 Act: 20463171802953 Front.:  = 20463171802953 Home.:  = 20463171802953
#1149989 Act: 20473163586571 Front.:  = 20473163586571 Home.:  = 20473163586571
#1149990 Act: 20463166925176 Front.:  = 20463166925176 Home.: <> 20393190291827
#1149991 Act: 20473158706413 Front.:  = 20473158706413 Home.:  = 20473158706413
#1149992 Act: 20463162047401 Front.:  = 20463162047401 Home.:  = 20463162047401
#1149993 Act: 20473153826256 Front.:  = 20473153826256 Home.:  = 20473153826256
#1149994 Act: 20483150483909 Front.:  = 20483150483909 Home.:  = 20483150483909
#1149995 Act: 20493152022743 Front.:  = 20493152022743 Home.:  = 20493152022743
#1149996 Act: 20483145601369 Front.:  = 20483145601369 Home.:  = 20483145601369
#1149997 Act: 20493147137819 Front.:  = 20493147137819 Home.:  = 20493147137819
#1149998 Act: 20503153557831 Front.:  = 20503153557831 Home.: <> 20493147138331
#1149999 Act: 20513164863791 Front.:  = 20513164863791 Home.:  = 20513164863791
#1150000 Act: 20473100089179 Front.: <> 20503148670522 Home.:  = 20473100089179
#1150001 Act: 20483096720593 Front.:  = 20483096720593 Home.:  = 20483096720593
#1150002 Act: 20493098233175 Front.:  = 20493098233175 Home.:  = 20493098233175
#1150003 Act: 20503104629308 Front.:  = 20503104629308 Home.:  = 20503104629308
#1150004 Act: 20483082066706 Front.: <> 20493093348263 Home.:  = 20483082066706
#1150005 Act: 20453077552473 Front.: <> 20473080562303 Home.:  = 20453077552473
#1150006 Act: 20453077552985 Front.: <> 20443090698712 Home.:  = 20453077552985
#1150007 Act: 20413130136405 Front.: <> 20443090699224 Home.:  = 20413130136405
#1150008 Act: 20413130136917 Front.: <> 20423097485616 Home.:  = 20413130136917
#1150009 Act: 20423097486128 Front.:  = 20423097486128 Home.:  = 20423097486128
#1150010 Act: 20423097486640 Front.: <> 20413125271071 Home.:  = 20423097486640
#1150011 Act: 20433069702721 Front.:  = 20433069702721 Home.:  = 20433069702721
#1150012 Act: 20443046788048 Front.:  = 20443046788048 Home.:  = 20443046788048
#1150013 Act: 20443046788560 Front.: <> 20453028744999 Home.:  = 20443046788560
#1150014 Act: 20453028745511 Front.:  = 20453028745511 Home.:  = 20453028745511
#1150015 Act: 20463015576465 Front.:  = 20463015576465 Home.:  = 20463015576465
#1150016 Act: 20473007283801 Front.:  = 20473007283801 Home.:  = 20473007283801
#1150017 Act: 20463010698726 Front.:  = 20463010698726 Home.:  = 20463010698726
#1150018 Act: 20443027290354 Front.: <> 20453018994796 Home.:  = 20443027290354
#1150019 Act: 20413081450109 Front.: <> 20433045343947 Home.:  = 20413081450109
#1150020 Act: 20413081450621 Front.: <> 20403114125695 Home.:  = 20413081450621