From d1863fc51114ecb0d564e7f2bc9c711c8913ecba Mon Sep 17 00:00:00 2001 From: Ran Mishael Date: Sun, 17 Mar 2024 14:08:05 +0100 Subject: [PATCH] fix seen block bug. --- ecosystem/cache/handlers.go | 139 ++++++++++++++------ proto/lavanet/lava/pairing/relayCache.proto | 1 + protocol/chainlib/chain_fetcher.go | 3 +- protocol/rpcconsumer/rpcconsumer_server.go | 1 + x/pairing/types/relayCache.pb.go | 115 ++++++++++------ 5 files changed, 176 insertions(+), 83 deletions(-) diff --git a/ecosystem/cache/handlers.go b/ecosystem/cache/handlers.go index cb62be4e73..dd1f3c97e6 100644 --- a/ecosystem/cache/handlers.go +++ b/ecosystem/cache/handlers.go @@ -1,3 +1,20 @@ +// ============= GET ============= +// if seen block >= requested block && requested_block > 0 -> no need to fetch seen block in advance of get. +// if requested_block < 0 -> parse block, replace requested block, +// * check if seen_block >= replaced_requested_block -> no need to fetch seen and get. + +// else fetch seen + +// if seen >= requested_block -> seen_for_hash = requested (for key calculation) +// if seen < requested_block, seen_for_hash = 0 + +// fetch with the new key, check if result.seen_block >= my_seen ==> return hit +// else, the result is bad. cache miss. + +// ============ SET ========= +// if seen >= requested_block -> seen_for_hash = requested (for key calculation) +// if seen < requested_block, seen_for_hash = 0 + package cache import ( @@ -84,30 +101,74 @@ func (s *RelayerCacheServer) getSeenBlockForSharedStateMode(chainId string, shar func (s *RelayerCacheServer) GetRelay(ctx context.Context, relayCacheGet *pairingtypes.RelayCacheGet) (*pairingtypes.CacheRelayReply, error) { cacheReply := &pairingtypes.CacheRelayReply{} + var cacheReplyTmp *pairingtypes.CacheRelayReply var err error var seenBlock int64 - waitGroup := sync.WaitGroup{} - waitGroup.Add(2) // currently we have two groups getRelayInner and getSeenBlock - requestedBlock := relayCacheGet.RequestedBlock // save requested block + originalRequestedBlock := relayCacheGet.RequestedBlock // save requested block prior to swap + if originalRequestedBlock < 0 { // we need to fetch stored latest block information. + getLatestBlock := s.getLatestBlock(latestBlockKey(relayCacheGet.ChainId, "")) + relayCacheGet.RequestedBlock = lavaprotocol.ReplaceRequestedBlock(originalRequestedBlock, getLatestBlock) + } - // fetch all reads at the same time. - go func() { - defer waitGroup.Done() - var cacheReplyTmp *pairingtypes.CacheRelayReply + utils.LavaFormatDebug("Got Cache Get", utils.Attribute{Key: "request_hash", Value: string(relayCacheGet.RequestHash)}, + utils.Attribute{Key: "finalized", Value: relayCacheGet.Finalized}, + utils.Attribute{Key: "requested_block", Value: originalRequestedBlock}, + utils.Attribute{Key: "block_hash", Value: relayCacheGet.BlockHash}, + utils.Attribute{Key: "requested_block_parsed", Value: relayCacheGet.RequestedBlock}, + utils.Attribute{Key: "seen_block", Value: relayCacheGet.SeenBlock}, + ) + + // check seen block is larger than our requested block, we don't need to fetch seen block prior as its already larger than requested block + if relayCacheGet.SeenBlock >= relayCacheGet.RequestedBlock { + waitGroup := sync.WaitGroup{} + waitGroup.Add(2) // currently we have two groups getRelayInner and getSeenBlock + // fetch all reads at the same time. + go func() { + defer waitGroup.Done() + cacheReplyTmp, err = s.getRelayInner(relayCacheGet) + if cacheReplyTmp != nil { + cacheReply = cacheReplyTmp // set cache reply only if its not nil, as we need to store seen block in it. + } + }() + go func() { + defer waitGroup.Done() + // set seen block if required + seenBlock = s.getSeenBlockForSharedStateMode(relayCacheGet.ChainId, relayCacheGet.SharedStateId) + }() + // wait for all reads to complete before moving forward + waitGroup.Wait() + } else { + // our seen block might change our cache key value when shared state is enabled, we need to fetch it prior to moving forward + // fetch seen block prior to cache + seenBlock = s.getSeenBlockForSharedStateMode(relayCacheGet.ChainId, relayCacheGet.SharedStateId) + if seenBlock > relayCacheGet.SeenBlock { + relayCacheGet.SeenBlock = seenBlock // update state. + } + // now that we have our updated seen block state we can cacheReplyTmp, err = s.getRelayInner(relayCacheGet) if cacheReplyTmp != nil { cacheReply = cacheReplyTmp // set cache reply only if its not nil, as we need to store seen block in it. } - }() - go func() { - defer waitGroup.Done() - // set seen block if required - seenBlock = s.getSeenBlockForSharedStateMode(relayCacheGet.ChainId, relayCacheGet.SharedStateId) - }() + } + + // ============= GET ============= + // if seen block >= requested block && requested_block > 0 -> no need to fetch seen block in advance of get. + // if requested_block < 0 -> parse block, replace requested block, + // * check if seen_block >= replaced_requested_block -> no need to fetch seen and get. + + // else fetch seen + + // if seen >= requested_block -> seen_for_hash = requested (for key calculation) + // if seen < requested_block, seen_for_hash = 0 + + // fetch with the new key, check if result.seen_block >= my_seen ==> return hit + // else, the result is bad. cache miss. + + // ============ SET ========= + // if seen >= requested_block -> seen_for_hash = requested (for key calculation) + // if seen < requested_block, seen_for_hash = 0 - // wait for all reads to complete before moving forward - waitGroup.Wait() // set seen block. if seenBlock > cacheReply.SeenBlock { cacheReply.SeenBlock = seenBlock @@ -115,46 +176,43 @@ func (s *RelayerCacheServer) GetRelay(ctx context.Context, relayCacheGet *pairin // add prometheus metrics asynchronously go func() { + cacheMetricsContext, cancel := context.WithTimeout(context.Background(), time.Second) + defer cancel() var hit bool if err != nil { - s.cacheMiss(ctx, err) + s.cacheMiss(cacheMetricsContext, err) } else { hit = true - s.cacheHit(ctx) + s.cacheHit(cacheMetricsContext) } - s.CacheServer.CacheMetrics.AddApiSpecific(requestedBlock, relayCacheGet.ChainId, hit) + s.CacheServer.CacheMetrics.AddApiSpecific(originalRequestedBlock, relayCacheGet.ChainId, hit) }() return cacheReply, err } -// add the requested block to the hash key information so we hit the right block. -func (s *RelayerCacheServer) formatHashKey(hash []byte, latestBlock int64) []byte { - // Convert the int64 number to a byte array - numBytes := make([]byte, 8) - binary.LittleEndian.PutUint64(numBytes, uint64(latestBlock)) - - // Append the int64 byte array to the hash byte array - hash = append(hash, numBytes...) +// formatHashKey formats the hash key by adding latestBlock and seenBlock information. +// If seenBlock is greater than or equal to latestBlock, seenBlock is set to latestBlock for key calculation, +// otherwise, it's set to 0. +func (s *RelayerCacheServer) formatHashKey(hash []byte, latestBlock int64, seenBlock int64) []byte { + // Handle seenBlock according to the specified rules + if seenBlock >= latestBlock { + seenBlock = latestBlock + } else { + seenBlock = 0 + } + // Append the latestBlock and seenBlock directly to the hash using little-endian encoding + hash = binary.LittleEndian.AppendUint64(hash, uint64(latestBlock)) + hash = binary.LittleEndian.AppendUint64(hash, uint64(seenBlock)) return hash } func (s *RelayerCacheServer) getRelayInner(relayCacheGet *pairingtypes.RelayCacheGet) (*pairingtypes.CacheRelayReply, error) { - requestedBlock := relayCacheGet.RequestedBlock - // get the latest block per chain, on consumer side .Provider is empty, - // on the provider side it contains the provider public key to distinguish between different providers using the same cache service. - getLatestBlock := s.getLatestBlock(latestBlockKey(relayCacheGet.ChainId, "")) - relayCacheGet.RequestedBlock = lavaprotocol.ReplaceRequestedBlock(requestedBlock, getLatestBlock) // cache key is compressed from: // 1. Request hash including all the information inside RelayPrivateData (Salt can cause issues if not dealt with on consumer side.) // 2. chain-id (same requests for different chains should get unique results) - // 3. provider address, different providers can return different results on none deterministic responses. we want to have consistency. - cacheKey := s.formatHashKey(relayCacheGet.RequestHash, relayCacheGet.RequestedBlock) - utils.LavaFormatDebug("Got Cache Get", utils.Attribute{Key: "cacheKey", Value: string(cacheKey)}, - utils.Attribute{Key: "finalized", Value: relayCacheGet.Finalized}, - utils.Attribute{Key: "requestedBlock", Value: requestedBlock}, - utils.Attribute{Key: "requestHash", Value: relayCacheGet.BlockHash}, - utils.Attribute{Key: "getLatestBlock", Value: relayCacheGet.RequestedBlock}, - ) + // 3. seen block to distinguish between seen entries and unseen entries. + cacheKey := s.formatHashKey(relayCacheGet.RequestHash, relayCacheGet.RequestedBlock, relayCacheGet.SeenBlock) + cacheVal, cache_source, found := s.findInAllCaches(relayCacheGet.Finalized, cacheKey) // TODO: use the information when a new block is finalized if !found { @@ -229,8 +287,7 @@ func (s *RelayerCacheServer) SetRelay(ctx context.Context, relayCacheSet *pairin if relayCacheSet.RequestedBlock < 0 { return nil, utils.LavaFormatError("invalid relay cache set data, request block is negative", nil, utils.Attribute{Key: "requestBlock", Value: relayCacheSet.RequestedBlock}) } - // TODO: make this non-blocking - cacheKey := s.formatHashKey(relayCacheSet.RequestHash, relayCacheSet.RequestedBlock) + cacheKey := s.formatHashKey(relayCacheSet.RequestHash, relayCacheSet.RequestedBlock, relayCacheSet.SeenBlock) cacheValue := formatCacheValue(relayCacheSet.Response, relayCacheSet.BlockHash, relayCacheSet.Finalized, relayCacheSet.OptionalMetadata) utils.LavaFormatDebug("Got Cache Set", utils.Attribute{Key: "cacheKey", Value: string(cacheKey)}, utils.Attribute{Key: "finalized", Value: fmt.Sprintf("%t", relayCacheSet.Finalized)}, diff --git a/proto/lavanet/lava/pairing/relayCache.proto b/proto/lavanet/lava/pairing/relayCache.proto index e12e46b661..faebc42da3 100644 --- a/proto/lavanet/lava/pairing/relayCache.proto +++ b/proto/lavanet/lava/pairing/relayCache.proto @@ -36,6 +36,7 @@ message RelayCacheGet { int64 requested_block = 4; string shared_state_id = 5; // empty id for no shared state string chain_id = 6; // used to set latest block per chain. + int64 seen_block = 7; } message RelayCacheSet { diff --git a/protocol/chainlib/chain_fetcher.go b/protocol/chainlib/chain_fetcher.go index 69d035ab26..2b78de6b10 100644 --- a/protocol/chainlib/chain_fetcher.go +++ b/protocol/chainlib/chain_fetcher.go @@ -489,8 +489,7 @@ func HashCacheRequestInner(relayData *pairingtypes.RelayPrivateData, chainId str inputFormatter, outputFormatter := formatter.FormatterForRelayRequestAndResponse(relayData.ApiInterface) relayData.Data = inputFormatter(relayData.Data) // remove id from request. relayData.Salt = nil // remove salt - // TODO: Do we need to set this to 0? or in some cases the data is no longer relevant and we need to set it to a value - relayData.SeenBlock = 0 // remove seen block changes + relayData.SeenBlock = 0 // remove seen block // we remove the discrepancy of requested block from the hash, and add it on the cache side instead // this is due to the fact that we don't know the latest seen block at this moment, as on shared state // only the cache has this information. we make sure the hashing at this stage does not include the requested block. diff --git a/protocol/rpcconsumer/rpcconsumer_server.go b/protocol/rpcconsumer/rpcconsumer_server.go index da53de67ea..1bf234bb15 100644 --- a/protocol/rpcconsumer/rpcconsumer_server.go +++ b/protocol/rpcconsumer/rpcconsumer_server.go @@ -455,6 +455,7 @@ func (rpccs *RPCConsumerServer) sendRelayToProvider( BlockHash: nil, Finalized: false, SharedStateId: sharedStateId, + SeenBlock: relayRequestData.SeenBlock, }) // caching in the portal doesn't care about hashes, and we don't have data on finalization yet cancel() reply := cacheReply.GetReply() diff --git a/x/pairing/types/relayCache.pb.go b/x/pairing/types/relayCache.pb.go index 3c6468a2c6..67336455b2 100644 --- a/x/pairing/types/relayCache.pb.go +++ b/x/pairing/types/relayCache.pb.go @@ -201,6 +201,7 @@ type RelayCacheGet struct { RequestedBlock int64 `protobuf:"varint,4,opt,name=requested_block,json=requestedBlock,proto3" json:"requested_block,omitempty"` SharedStateId string `protobuf:"bytes,5,opt,name=shared_state_id,json=sharedStateId,proto3" json:"shared_state_id,omitempty"` ChainId string `protobuf:"bytes,6,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + SeenBlock int64 `protobuf:"varint,7,opt,name=seen_block,json=seenBlock,proto3" json:"seen_block,omitempty"` } func (m *RelayCacheGet) Reset() { *m = RelayCacheGet{} } @@ -278,6 +279,13 @@ func (m *RelayCacheGet) GetChainId() string { return "" } +func (m *RelayCacheGet) GetSeenBlock() int64 { + if m != nil { + return m.SeenBlock + } + return 0 +} + type RelayCacheSet struct { RequestHash []byte `protobuf:"bytes,1,opt,name=request_hash,json=requestHash,proto3" json:"request_hash,omitempty"` BlockHash []byte `protobuf:"bytes,2,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` @@ -399,46 +407,46 @@ func init() { } var fileDescriptor_36fbab536e2bbad1 = []byte{ - // 612 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0x4d, 0x6b, 0xd4, 0x5c, - 0x14, 0x4e, 0x3a, 0xd3, 0xe9, 0xe4, 0x4c, 0xfb, 0xf6, 0xf5, 0x52, 0x64, 0x1c,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fa, 0x17, 0x5d, 0xab, 0x17, 0x9f, 0xdb, 0x33, 0x1b, 0xf4, 0xd3, 0x78, 0x87, 0xca, 0x7e, - 0x82, 0xa2, 0x5b, 0xa3, 0xb0, 0x8f, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x6b, 0xec, 0x7e, 0xab, - 0xbb, 0x05, 0x00, 0x00, + // 615 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xcd, 0x6e, 0xd3, 0x5c, + 0x10, 0xb5, 0x9b, 0x34, 0x89, 0x27, 0xed, 0xd7, 0x8f, 0xab, 0x0a, 0x85, 0xd0, 0x1a, 0x63, 0xd4, + 0x9f, 0x95, 0x2d, 0x15, 0x89, 0x15, 0x0b, 0x28, 0x45, 0x6d, 0x25, 0x2a, 0x81, 0x23, 0x24, 0xc4, + 0x26, 0xba, 0x89, 0xa7, 0xb6, 0x85, 0x6b, 0x1b, 0xdf, 0xdb, 0x8a, 0xf2, 0x0a, 0x6c, 0x78, 0x1f, + 0x5e, 0xa0, 0xcb, 0x2e, 0x59, 0x21, 0x94, 0x3c, 0x05, 0xac, 0x90, 0x27, 0x76, 0xfe, 0xe4, 0x46, + 0x95, 0x60, 0x65, 0xdf, 0x73, 0xcf, 0xdc, 0x99, 0x39, 0x67, 0x34, 0xb0, 0x15, 0xf2, 0x0b, 0x1e, + 0xa1, 0xb4, 0xb3, 0xaf, 0x9d, 0xf0, 0x20, 0x0d, 0x22, 0xcf, 0x4e, 0x31, 0xe4, 0x97, 0x2f, 0x78, + 0xdf, 0x47, 0x2b, 0x49, 0x63, 0x19, 0xb3, 0xf5, 0x9c, 0x66, 0x65, 0x5f, 0x2b, 0xa7, 0xb5, 0xd7, + 0xbd, 0xd8, 0x8b, 0x89, 0x60, 0x67, 0x7f, 0x23, 0x6e, 0xdb, 0xb8, 0xf9, 0xc9, 0x9c, 0x71, 0xdf, + 0x8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3e, 0x76, 0xcd, 0xdf, 0x2a, 0xac, 0x3a, 0x63, + 0xd7, 0x0f, 0x51, 0xb2, 0x87, 0xb0, 0x92, 0xc7, 0x75, 0x7d, 0x2e, 0x7c, 0xca, 0xb9, 0xe2, 0x34, + 0x73, 0x8c, 0x2a, 0xda, 0x04, 0x20, 0x19, 0x46, 0x84, 0x25, 0x22, 0x68, 0x84, 0xd0, 0xf5, 0x06, + 0x68, 0xa7, 0x41, 0xc4, 0xc3, 0xe0, 0x33, 0xba, 0xa4, 0x54, 0xc3, 0x99, 0x00, 0x6c, 0x07, 0xd6, + 0xf2, 0xb7, 0xd0, 0xcd, 0xd5, 0xac, 0x92, 0x9a, 0xff, 0x8d, 0x61, 0x92, 0x94, 0x6d, 0xc3, 0x9a, + 0xf0, 0x79, 0x8a, 0x6e, 0x57, 0x48, 0x2e, 0x31, 0x2b, 0x7e, 0x99, 0x8a, 0x5f, 0x1d, 0xc1, 0x9d, + 0x0c, 0x3d, 0x76, 0x67, 0xba, 0xab, 0xcd, 0x74, 0x37, 0x67, 0x5a, 0x7d, 0xde, 0xb4, 0x2f, 0x95, + 0xe9, 0xe6, 0x3b, 0xff, 0xa4, 0xf9, 0xa7, 0xd0, 0x48, 0x51, 0x24, 0x71, 0x24, 0x90, 0x7a, 0xbf, + 0xcd, 0xd4, 0x8e, 0x23, 0x66, 0xa5, 0xab, 0xce, 0x4b, 0x57, 0x3a, 0xd6, 0xcb, 0x7f, 0x35, 0xd6, + 0x25, 0x22, 0xd7, 0xca, 0x44, 0x2e, 0x71, 0xad, 0x5e, 0xea, 0xda, 0xb4, 0x1b, 0xda, 0x22, 0x37, + 0x60, 0xce, 0x8d, 0xbd, 0x5f, 0x2a, 0xac, 0x90, 0x28, 0x98, 0x92, 0x1f, 0xec, 0x1d, 0x34, 0x0e, + 0x51, 0x12, 0xc4, 0x1e, 0x2d, 0x10, 0xb1, 0x18, 0xdd, 0xf6, 0x56, 0x39, 0x69, 0x6e, 0xab, 0x98, + 0x0a, 0x3b, 0x86, 0x46, 0xe7, 0xd6, 0x2f, 0x77, 0x50, 0xb6, 0xef, 0x5a, 0xa3, 0xd5, 0x65, 0x15, + 0xab, 0xcb, 0x7a, 0x99, 0xad, 0x2e, 0x53, 0x61, 0x07, 0x50, 0x3b, 0x42, 0x1e, 0x4a, 0x9f, 0xdd, + 0xc0, 0x69, 0x1b, 0x0b, 0xaa, 0xa2, 0x75, 0x61, 0x2a, 0xfb, 0xcf, 0xaf, 0x06, 0xba, 0x7a, 0x3d, + 0xd0, 0xd5, 0x9f, 0x03, 0x5d, 0xfd, 0x3a, 0xd4, 0x95, 0xeb, 0xa1, 0xae, 0x7c, 0x1f, 0xea, 0xca, + 0xfb, 0x1d, 0x2f, 0x90, 0xfe, 0x79, 0xcf, 0xea, 0xc7, 0x67, 0xf6, 0xcc, 0x82, 0xfd, 0x34, 0x5e, + 0xb1, 0xf2, 0x32, 0x41, 0xd1, 0xab, 0x51, 0xda, 0xc7, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xe0, + 0xbe, 0x60, 0xe4, 0xda, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -742,6 +750,11 @@ func (m *RelayCacheGet) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.SeenBlock != 0 { + i = encodeVarintRelayCache(dAtA, i, uint64(m.SeenBlock)) + i-- + dAtA[i] = 0x38 + } if len(m.ChainId) > 0 { i -= len(m.ChainId) copy(dAtA[i:], m.ChainId) @@ -978,6 +991,9 @@ func (m *RelayCacheGet) Size() (n int) { if l > 0 { n += 1 + l + sovRelayCache(uint64(l)) } + if m.SeenBlock != 0 { + n += 1 + sovRelayCache(uint64(m.SeenBlock)) + } return n } @@ -1576,6 +1592,25 @@ func (m *RelayCacheGet) Unmarshal(dAtA []byte) error { } m.ChainId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SeenBlock", wireType) + } + m.SeenBlock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRelayCache + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SeenBlock |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipRelayCache(dAtA[iNdEx:])