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
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
13 changes: 13 additions & 0 deletions vm/resolutions.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,11 @@ func (vm *VM) processAcceptedBlock(b *chain.StatelessBlock) {
vm.Fatal("accepted processing failed", zap.Error(err))
}

for i, tx := range b.Txs {
// Only cache auth for accepted blocks to prevent cache manipulation from RPC submissions
vm.cacheAuth(tx.Auth)
wlawt marked this conversation as resolved.
Show resolved Hide resolved
}

// Update server
if err := vm.webSocketServer.AcceptBlock(b); err != nil {
vm.Fatal("unable to accept block in websocket server", zap.Error(err))
Expand Down Expand Up @@ -416,6 +421,14 @@ func (vm *VM) GetAuthBatchVerifier(authTypeID uint8, cores int, count int) (chai
return bv.GetBatchVerifier(cores, count), ok
}

func (vm *VM) cacheAuth(auth chain.Auth) {
bv, ok := vm.authEngine[auth.GetTypeID()]
if !ok {
return
}
bv.Cache(auth)
}

func (vm *VM) RecordBlockVerify(t time.Duration) {
vm.metrics.blockVerify.Observe(float64(t))
}
Expand Down