Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sokol v0: support for first epoch-set transition #2411

Merged
merged 28 commits into from
Jul 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
3557c42
broadcast local txs
AskAlexSharov Jul 13, 2021
d63ddc6
Merge branch 'devel' into sokol10
AskAlexSharov Jul 14, 2021
79e0b92
finality checker works
AskAlexSharov Jul 14, 2021
bdc6a27
finality checker works
AskAlexSharov Jul 14, 2021
0a36ac3
Merge branch 'devel' into sokol10
AskAlexSharov Jul 14, 2021
07f0a23
Merge branch 'devel' into sokol10
AskAlexSharov Jul 15, 2021
c3ee02f
Merge branch 'devel' into sokol10
AskAlexSharov Jul 15, 2021
f2a4db3
fix
AskAlexSharov Jul 15, 2021
8022a14
fix finalization
AskAlexSharov Jul 15, 2021
dd934e3
Merge branch 'devel' into sokol10
AskAlexSharov Jul 16, 2021
2a59ffa
save
AskAlexSharov Jul 16, 2021
fe414eb
merge devel
AskAlexSharov Jul 17, 2021
f64ad48
Merge branch 'devel' into sokol10
AskAlexSharov Jul 17, 2021
c083870
lint
AskAlexSharov Jul 17, 2021
14a0cd3
clean
AskAlexSharov Jul 17, 2021
808600c
clean
AskAlexSharov Jul 17, 2021
a1b5648
remove builder
AskAlexSharov Jul 17, 2021
10e0770
save
AskAlexSharov Jul 17, 2021
1732262
build finality never returns error
AskAlexSharov Jul 17, 2021
e91436a
Merge branch 'devel' into sokol10
AskAlexSharov Jul 17, 2021
7e96672
Merge branch 'devel' into sokol10
AskAlexSharov Jul 18, 2021
e9e6591
Merge branch 'devel' into sokol10
AskAlexSharov Jul 20, 2021
67785d0
merge devels
AskAlexSharov Jul 21, 2021
bd07fe3
Merge branch 'devel' into sokol10
AskAlexSharov Jul 21, 2021
1d53873
save
AskAlexSharov Jul 21, 2021
b374414
Merge branch 'devel' into sokol10
AskAlexSharov Jul 21, 2021
8bf5014
implement epoch-set transition
AskAlexSharov Jul 21, 2021
11fbe9c
implement epoch-set transition
AskAlexSharov Jul 21, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ linters:
- unused
- varcheck
- gocritic
# - forcetypeassert

linters-settings:
gocritic:
Expand Down
2 changes: 1 addition & 1 deletion cmd/hack/hack.go
Original file line number Diff line number Diff line change
Expand Up @@ -2257,7 +2257,7 @@ func runBlock(ibs *state.IntraBlockState, txnWriter state.StateWriter, blockWrit

if !vmConfig.ReadOnly {
// Finalize the block, applying any consensus engine specific extras (e.g. block rewards)
if _, err := engine.FinalizeAndAssemble(chainConfig, header, ibs, block.Transactions(), block.Uncles(), receipts, nil, nil); err != nil {
if _, err := engine.FinalizeAndAssemble(chainConfig, header, ibs, block.Transactions(), block.Uncles(), receipts, nil, nil, nil, nil); err != nil {
return nil, fmt.Errorf("finalize of block %d failed: %v", block.NumberU64(), err)
}

Expand Down
8 changes: 6 additions & 2 deletions cmd/integration/commands/reset_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ func resetExec(tx ethdb.RwTx, g *core.Genesis) error {
if err := tx.(ethdb.BucketMigrator).ClearBucket(dbutils.Epoch); err != nil {
return err
}
if err := tx.(ethdb.BucketMigrator).ClearBucket(dbutils.PendingEpoch); err != nil {
return err
}
if err := stages.SaveStageProgress(tx, stages.Execution, 0); err != nil {
return err
}
Expand Down Expand Up @@ -247,6 +250,7 @@ func printStages(db ethdb.KVGetter) error {
defer w.Flush()
w.Init(os.Stdout, 8, 8, 0, '\t', 0)
fmt.Fprintf(w, "Note: prune_at doesn't mean 'all data before were deleted' - it just mean stage.Prune function were run to this block. Because 1 stage may prune multiple data types to different prune distance.\n")
fmt.Fprint(w, "\n \t stage_at \t prune_at\n")
for _, stage := range stages.AllStages {
if progress, err = stages.GetStageProgress(db, stage); err != nil {
return err
Expand All @@ -255,13 +259,13 @@ func printStages(db ethdb.KVGetter) error {
if err != nil {
return err
}
fmt.Fprintf(w, "%s \t %d \t prune_at=%d\n", string(stage), progress, prunedTo)
fmt.Fprintf(w, "%s \t %d \t %d\n", string(stage), progress, prunedTo)
}
pm, err := prune.Get(db)
if err != nil {
return err
}
fmt.Fprintf(w, "--\n")
fmt.Fprintf(w, "prune distance: %#v\n", pm)
fmt.Fprintf(w, "prune distance: %s\n\n", pm.ToString())
return nil
}
3 changes: 3 additions & 0 deletions cmd/integration/commands/state_stages.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ func syncBySmallSteps(db ethdb.RwKV, miningConfig params.MiningConfig, ctx conte
expectedAccountChanges := make(map[uint64]*changeset.ChangeSet)
expectedStorageChanges := make(map[uint64]*changeset.ChangeSet)
changeSetHook := func(blockNum uint64, csw *state.ChangeSetWriter) {
if csw == nil {
return
}
accountChanges, err := csw.GetAccountChanges()
if err != nil {
panic(err)
Expand Down
2 changes: 1 addition & 1 deletion cmd/snapshots/debug/debug_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func TestMatreshkaStream(t *testing.T) {

checkTEVM := ethdb.GetCheckTEVM(tx)

_, err = core.ExecuteBlockEphemerally(chainConfig, &vm.Config{NoReceipts: true}, getHeader, ethash.NewFaker(), block, stateReaderWriter, stateReaderWriter, nil, checkTEVM)
_, err = core.ExecuteBlockEphemerally(chainConfig, &vm.Config{NoReceipts: true}, getHeader, ethash.NewFaker(), block, stateReaderWriter, stateReaderWriter, nil, nil, checkTEVM)
if err != nil {
t.Fatal(err, currentBlock)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/state/commands/opcode_tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ func runBlock(ibs *state.IntraBlockState, txnWriter state.StateWriter, blockWrit

if !vmConfig.ReadOnly {
// Finalize the block, applying any consensus engine specific extras (e.g. block rewards)
if _, err := engine.FinalizeAndAssemble(chainConfig, header, ibs, block.Transactions(), block.Uncles(), receipts, nil, nil); err != nil {
if _, err := engine.FinalizeAndAssemble(chainConfig, header, ibs, block.Transactions(), block.Uncles(), receipts, nil, nil, nil, nil); err != nil {
return nil, fmt.Errorf("finalize of block %d failed: %v", block.NumberU64(), err)
}

Expand Down
4 changes: 3 additions & 1 deletion common/dbutils/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,8 @@ const (
Sequence = "Sequence" // tbl_name -> seq_u64
HeadHeaderKey = "LastHeader"

Epoch = "DevEpoch" // block_num_u64+block_hash->transition_proof
Epoch = "DevEpoch" // block_num_u64+block_hash->transition_proof
PendingEpoch = "DevPendingEpoch" // block_num_u64+block_hash->transition_proof
)

// Keys
Expand Down Expand Up @@ -348,6 +349,7 @@ var Buckets = []string{
HeadersBucket,
HeaderTDBucket,
Epoch,
PendingEpoch,
}

// DeprecatedBuckets - list of buckets which can be programmatically deleted - for example after migration
Expand Down
2 changes: 1 addition & 1 deletion common/etl/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func (c *Collector) Close(logPrefix string) {
totalSize += p.Dispose()
}
if totalSize > 0 {
log.Info(fmt.Sprintf("[%s] etl: temp files removed successfully", logPrefix), "total size", datasize.ByteSize(totalSize).HumanReadable())
log.Info(fmt.Sprintf("[%s] etl: temp files removed", logPrefix), "total size", datasize.ByteSize(totalSize).HumanReadable())
}
}

Expand Down
Loading