Skip to content

Commit

Permalink
Merge branch 'main' into feat/v1.13.15
Browse files Browse the repository at this point in the history
  • Loading branch information
tak1827 committed Nov 13, 2024
2 parents 35b4084 + a9325a2 commit e1f86a4
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build Geth in a stock Go builder container
FROM golang:1.20.14-bookworm as builder
FROM golang:1.21.13-bookworm as builder

# Support setting various labels on the final image
ARG COMMIT=""
Expand Down
10 changes: 10 additions & 0 deletions consensus/oasys/oasys.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,16 @@ func (c *Oasys) verifyCascadingFields(chain consensus.ChainHeaderReader, header
}
}

// Verify vote attestation for fast finality.
if err := c.verifyVoteAttestation(chain, header, parents, env); err != nil {
log.Warn("Verify vote attestation failed", "error", err, "hash", header.Hash(), "number", header.Number,
"parent", header.ParentHash, "coinbase", header.Coinbase, "extra", common.Bytes2Hex(header.Extra))
verifyVoteAttestationErrorCounter.Inc(1)
if chain.Config().IsFastFinalityEnabled(header.Number) {
return err
}
}

// All basic checks passed, verify the seal and return
return c.verifySeal(chain, header, parents, scheduler)
}
Expand Down
4 changes: 2 additions & 2 deletions contracts/oasys/deployments.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var deploymentSets = map[common.Hash]map[uint64]deploymentSet{
1529980: deploymentSet{deployments9},
1892000: deploymentSet{deployments10},
4089588: deploymentSet{deployments11},
9999998: deploymentSet{deployments12}, // TODO
5095900: deploymentSet{deployments12},
},
params.OasysTestnetGenesisHash: {
1: deploymentSet{deployments0},
Expand All @@ -35,7 +35,7 @@ var deploymentSets = map[common.Hash]map[uint64]deploymentSet{
1519840: deploymentSet{deployments9},
1880660: deploymentSet{deployments10},
4017600: deploymentSet{deployments11},
9999998: deploymentSet{deployments12}, // TODO
4958700: deploymentSet{deployments12},
},
defaultGenesisHash: {
2: deploymentSet{
Expand Down
7 changes: 5 additions & 2 deletions contracts/oasys/oasys_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1119,6 +1119,9 @@ func _deployments12(genesisHash common.Hash, contracts wantContracts) {

// CandidateValidatorManager
contracts["0x520000000000000000000000000000000000002e"].codeHash = "6de4d098a3297020346dcb7b2ba4914c"

// LOAS
contracts["0x5200000000000000000000000000000000000023"].codeHash = "044637c8af353e46615765c8755265d6"
}

func TestDeploy(t *testing.T) {
Expand Down Expand Up @@ -1149,7 +1152,7 @@ func TestDeploy(t *testing.T) {
{1529980, []deployFn{_deployments9}},
{1892000, []deployFn{_deployments10}},
{4089588, []deployFn{_deployments11}},
{9999998, []deployFn{_deployments12}},
{5095900, []deployFn{_deployments12}},
},
},
{
Expand All @@ -1169,7 +1172,7 @@ func TestDeploy(t *testing.T) {
{1519840, []deployFn{_deployments9}},
{1880660, []deployFn{_deployments10}},
{4017600, []deployFn{_deployments11}},
{4428900, []deployFn{_deployments12}},
{4958700, []deployFn{_deployments12}},
},
},
{
Expand Down
3 changes: 2 additions & 1 deletion core/vm/jump_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,14 @@ func newCancunInstructionSet() JumpTable {
}

func newShanghaiInstructionSet() JumpTable {
instructionSet := newMergeInstructionSet()
instructionSet := newLondonInstructionSet()
enable3855(&instructionSet) // PUSH0 instruction
enable3860(&instructionSet) // Limit and meter initcode

return validate(instructionSet)
}

// Skip the Merge instruction set, as Oasys does not support RANDAO
func newMergeInstructionSet() JumpTable {
instructionSet := newLondonInstructionSet()
instructionSet[PREVRANDAO] = &operation{
Expand Down
2 changes: 1 addition & 1 deletion eth/peerset.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ func (ps *peerSet) peerWithHighestJustifiedBlockAndTD() (bestPeer *eth.Peer, bes
continue
}
_, td := p.Head()
if *justified > bestJustified || (*justified == bestJustified && td.Cmp(bestTd) > 0) {
if bestPeer == nil || *justified > bestJustified || (*justified == bestJustified && td.Cmp(bestTd) > 0) {
bestPeer, bestJustified, bestTd = p.Peer, *justified, td
}
}
Expand Down
4 changes: 2 additions & 2 deletions eth/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ func (cs *chainSyncer) nextSyncOp() *chainSyncOp {
if peerJustified < *ourJustified {
return nil
}
// Ignored because justified block height is the same but TD is lower.
if peerJustified == *ourJustified && peerTD.Cmp(ourTD) < 0 {
// Ignored because justified block height is the same but TD is the same or lower.
if peerJustified == *ourJustified && peerTD.Cmp(ourTD) <= 0 {
return nil
}
}
Expand Down
4 changes: 2 additions & 2 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -663,10 +663,10 @@ func (c *ChainConfig) OasysFastFinalityEnabledBlock() *big.Int {
return nil
}
if c.ChainID.Cmp(OasysMainnetChainConfig.ChainID) == 0 {
return big.NewInt(9999999)
return big.NewInt(5095900) // Mon Nov 18 2024 17:00:00 GMT+0900
}
if c.ChainID.Cmp(OasysTestnetChainConfig.ChainID) == 0 {
return big.NewInt(9999999)
return big.NewInt(4958700) // Thu Oct 31 2024 18:00:00 GMT+0900
}
return big.NewInt(2)
}
Expand Down

0 comments on commit e1f86a4

Please sign in to comment.