Skip to content

Commit

Permalink
final bsc main net feynman && feynmanFix (#347)
Browse files Browse the repository at this point in the history
  • Loading branch information
blxdyx authored Apr 2, 2024
1 parent 76e007c commit e2d2113
Show file tree
Hide file tree
Showing 8 changed files with 83 additions and 16 deletions.
2 changes: 1 addition & 1 deletion cmd/erigon-el-mock/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ func HeaderToHeaderRPC(header *types.Header) *execution.Header {
TransactionHash: gointerfaces.ConvertHashToH256(header.TxHash),
LogsBloom: gointerfaces.ConvertBytesToH2048(header.Bloom[:]),
ReceiptRoot: gointerfaces.ConvertHashToH256(header.ReceiptHash),
PrevRandao: gointerfaces.ConvertHashToH256(header.MixDigest),
PrevRandao: gointerfaces.ConvertHashToH256(header.MixDigest),
BlockNumber: header.Number.Uint64(),
Nonce: header.Nonce.Uint64(),
GasLimit: header.GasLimit,
Expand Down
2 changes: 1 addition & 1 deletion cmd/erigon-el/eth1/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ func HeaderToHeaderRPC(header *types.Header) *execution.Header {
TransactionHash: gointerfaces.ConvertHashToH256(header.TxHash),
LogsBloom: gointerfaces.ConvertBytesToH2048(header.Bloom[:]),
ReceiptRoot: gointerfaces.ConvertHashToH256(header.ReceiptHash),
PrevRandao: gointerfaces.ConvertHashToH256(header.MixDigest),
PrevRandao: gointerfaces.ConvertHashToH256(header.MixDigest),
BlockNumber: header.Number.Uint64(),
Nonce: header.Nonce.Uint64(),
GasLimit: header.GasLimit,
Expand Down
2 changes: 1 addition & 1 deletion cmd/evm/internal/t8ntool/gen_stenv.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

67 changes: 66 additions & 1 deletion core/systemcontracts/upgrade.go

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions params/chainspecs/bsc.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
"hertzfixBlock": 34140700,
"shanghaiTime":1705996800,
"keplerTime": 1705996800,
"feynmanTime": 1713419340,
"feynmanFixTime":1713419340,
"parlia": {
"DBPath": "",
"InMemory": false,
Expand Down
2 changes: 1 addition & 1 deletion params/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var (
const (
VersionMajor = 1 // Major version component of the current release
VersionMinor = 1 // Minor version component of the current release
VersionMicro = 16 // Patch version component of the current release
VersionMicro = 17 // Patch version component of the current release
VersionModifier = "dev" // Modifier component of the current release
VersionKeyCreated = "ErigonVersionCreated"
VersionKeyFinished = "ErigonVersionFinished"
Expand Down
18 changes: 9 additions & 9 deletions turbo/stages/sentry_mock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func TestMineBlockWith1Tx(t *testing.T) {
m.ReceiveWg.Wait() // Wait for all messages to be processed before we proceeed

initialCycle := true
if _, err := stages.StageLoopStep(m.Ctx, m.DB, m.Sync, initialCycle, nil, nil); err != nil {
if _, err := stages.StageLoopStep(m.Ctx, m.DB, m.Sync, initialCycle, nil, nil); err != nil {
t.Fatal(err)
}
}
Expand Down Expand Up @@ -216,7 +216,7 @@ func TestReorg(t *testing.T) {
m.ReceiveWg.Wait() // Wait for all messages to be processed before we proceeed

initialCycle = false
if _, err := stages.StageLoopStep(m.Ctx, m.DB, m.Sync, initialCycle,nil, nil); err != nil {
if _, err := stages.StageLoopStep(m.Ctx, m.DB, m.Sync, initialCycle, nil, nil); err != nil {
t.Fatal(err)
}

Expand Down Expand Up @@ -496,8 +496,8 @@ func TestAnchorReplace2(t *testing.T) {
m.ReceiveWg.Wait() // Wait for all messages to be processed before we proceeed

initialCycle := true
hook := stages.NewHook(m.Ctx, m.Notifications, m.Sync, m.ChainConfig, m.UpdateHead)
if _, err := stages.StageLoopStep(m.Ctx, m.DB, m.Sync, initialCycle, nil, hook); err != nil {
hook := stages.NewHook(m.Ctx, m.Notifications, m.Sync, m.ChainConfig, m.UpdateHead)
if _, err := stages.StageLoopStep(m.Ctx, m.DB, m.Sync, initialCycle, nil, hook); err != nil {
t.Fatal(err)
}
}
Expand Down Expand Up @@ -571,7 +571,7 @@ func TestPoSDownloader(t *testing.T) {
m.SendPayloadRequest(chain.TopBlock)

initialCycle := false
headBlockHash, err := stages.StageLoopStep(m.Ctx, m.DB, m.Sync, initialCycle,nil, nil)
headBlockHash, err := stages.StageLoopStep(m.Ctx, m.DB, m.Sync, initialCycle, nil, nil)
require.NoError(t, err)
stages.SendPayloadStatus(m.HeaderDownload(), headBlockHash, err)

Expand All @@ -591,7 +591,7 @@ func TestPoSDownloader(t *testing.T) {
m.ReceiveWg.Wait()

// First cycle: save the downloaded header
headBlockHash, err = stages.StageLoopStep(m.Ctx, m.DB, m.Sync, initialCycle, nil, nil)
headBlockHash, err = stages.StageLoopStep(m.Ctx, m.DB, m.Sync, initialCycle, nil, nil)
require.NoError(t, err)
stages.SendPayloadStatus(m.HeaderDownload(), headBlockHash, err)

Expand Down Expand Up @@ -746,7 +746,7 @@ func TestPOSWrontTrieRootReorgs(t *testing.T) {

//------------------------------------------
m.SendPayloadRequest(chain1.TopBlock)
headBlockHash, err = stages.StageLoopStep(m.Ctx, m.DB, m.Sync, initialCycle,nil, nil)
headBlockHash, err = stages.StageLoopStep(m.Ctx, m.DB, m.Sync, initialCycle, nil, nil)
require.NoError(err)
stages.SendPayloadStatus(m.HeaderDownload(), headBlockHash, err)
payloadStatus1 := m.ReceivePayloadStatus()
Expand Down Expand Up @@ -778,7 +778,7 @@ func TestPOSWrontTrieRootReorgs(t *testing.T) {
FinalizedBlockHash: chain2.TopBlock.Hash(),
}
m.SendForkChoiceRequest(&forkChoiceMessage)
headBlockHash, err = stages.StageLoopStep(m.Ctx, m.DB, m.Sync, initialCycle,nil, nil)
headBlockHash, err = stages.StageLoopStep(m.Ctx, m.DB, m.Sync, initialCycle, nil, nil)
require.NoError(err)
stages.SendPayloadStatus(m.HeaderDownload(), headBlockHash, err)
assert.Equal(t, chain2.TopBlock.Hash(), headBlockHash)
Expand All @@ -795,7 +795,7 @@ func TestPOSWrontTrieRootReorgs(t *testing.T) {
payloadStatus3 := m.ReceivePayloadStatus()
assert.Equal(t, remote.EngineStatus_VALID, payloadStatus3.Status)
m.SendPayloadRequest(chain3.TopBlock)
headBlockHash, err = stages.StageLoopStep(m.Ctx, m.DB, m.Sync, initialCycle,nil, nil)
headBlockHash, err = stages.StageLoopStep(m.Ctx, m.DB, m.Sync, initialCycle, nil, nil)
require.NoError(err)
stages.SendPayloadStatus(m.HeaderDownload(), headBlockHash, err)
payloadStatus3 = m.ReceivePayloadStatus()
Expand Down
4 changes: 2 additions & 2 deletions turbo/stages/stageloop.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func StageLoop(ctx context.Context,
}
}

func StageLoopStep(ctx context.Context, db kv.RwDB, sync *stagedsync.Sync, initialCycle bool, blockSnapshots *snapshotsync.RoSnapshots, hook *Hook) (headBlockHash libcommon.Hash, err error) {
func StageLoopStep(ctx context.Context, db kv.RwDB, sync *stagedsync.Sync, initialCycle bool, blockSnapshots *snapshotsync.RoSnapshots, hook *Hook) (headBlockHash libcommon.Hash, err error) {
defer func() {
if rec := recover(); rec != nil {
err = fmt.Errorf("%+v, trace: %s", rec, dbg.Stack())
Expand Down Expand Up @@ -234,7 +234,7 @@ type Hook struct {
updateHead func(ctx context.Context, headHeight uint64, headTime uint64, hash libcommon.Hash, td *uint256.Int)
}

func NewHook(ctx context.Context, notifications *shards.Notifications, sync *stagedsync.Sync, chainConfig *chain.Config, updateHead func(ctx context.Context, headHeight uint64, headTime uint64, hash libcommon.Hash, td *uint256.Int)) *Hook {
func NewHook(ctx context.Context, notifications *shards.Notifications, sync *stagedsync.Sync, chainConfig *chain.Config, updateHead func(ctx context.Context, headHeight uint64, headTime uint64, hash libcommon.Hash, td *uint256.Int)) *Hook {
return &Hook{ctx: ctx, notifications: notifications, sync: sync, chainConfig: chainConfig, updateHead: updateHead}
}
func (h *Hook) BeforeRun(tx kv.Tx, canRunCycleInOneTransaction bool) error {
Expand Down

0 comments on commit e2d2113

Please sign in to comment.