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

Remove Warp Integration #856

Merged
merged 29 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
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
33 changes: 2 additions & 31 deletions chain/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ import (
)

var (
_ snowman.Block = &StatelessBlock{}
_ block.WithVerifyContext = &StatelessBlock{}
_ block.StateSummary = &SyncableBlock{}
_ snowman.Block = &StatelessBlock{}
_ block.StateSummary = &SyncableBlock{}
)

type StatefulBlock struct {
Expand Down Expand Up @@ -252,34 +251,6 @@ func (b *StatelessBlock) initializeBuilt(
// implements "snowman.Block.choices.Decidable"
func (b *StatelessBlock) ID() ids.ID { return b.id }

// implements "block.WithVerifyContext"
func (*StatelessBlock) ShouldVerifyWithContext(context.Context) (bool, error) {
return false, nil
}

// implements "block.WithVerifyContext"
func (b *StatelessBlock) VerifyWithContext(ctx context.Context, _ *block.Context) error {
start := time.Now()
defer func() {
b.vm.RecordBlockVerify(time.Since(start))
}()

stateReady := b.vm.StateReady()
ctx, span := b.vm.Tracer().Start(
ctx, "StatelessBlock.VerifyWithContext",
trace.WithAttributes(
attribute.Int("txs", len(b.Txs)),
attribute.Int64("height", int64(b.Hght)),
attribute.Bool("stateReady", stateReady),
attribute.Bool("built", b.Processed()),
),
)
defer span.End()

// Proceed with normal verification
return b.verify(ctx, stateReady)
}

// implements "snowman.Block"
func (b *StatelessBlock) Verify(ctx context.Context) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may want to unify Build/build and Verify/verify for now but not sure where we use them.

start := time.Now()
Expand Down
11 changes: 5 additions & 6 deletions vm/resolutions.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,11 @@ import (
)

var (
_ chain.VM = (*VM)(nil)
_ gossiper.VM = (*VM)(nil)
_ builder.VM = (*VM)(nil)
_ block.ChainVM = (*VM)(nil)
_ block.StateSyncableVM = (*VM)(nil)
_ block.BuildBlockWithContextChainVM = (*VM)(nil)
_ chain.VM = (*VM)(nil)
_ gossiper.VM = (*VM)(nil)
_ builder.VM = (*VM)(nil)
_ block.ChainVM = (*VM)(nil)
_ block.StateSyncableVM = (*VM)(nil)
)

func (vm *VM) ChainID() ids.ID {
Expand Down
13 changes: 0 additions & 13 deletions vm/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -753,19 +753,6 @@ func (vm *VM) BuildBlock(ctx context.Context) (snowman.Block, error) {
return vm.buildBlock(ctx, nil)
wlawt marked this conversation as resolved.
Show resolved Hide resolved
}

// implements "block.BuildBlockWithContextChainVM"
func (vm *VM) BuildBlockWithContext(ctx context.Context, blockContext *block.Context) (snowman.Block, error) {
start := time.Now()
defer func() {
vm.metrics.blockBuild.Observe(float64(time.Since(start)))
}()

ctx, span := vm.tracer.Start(ctx, "VM.BuildBlockWithContext")
defer span.End()

return vm.buildBlock(ctx, blockContext)
}

func (vm *VM) Submit(
ctx context.Context,
verifyAuth bool,
Expand Down
Loading