From beb5b58b4bf4ad11bdc1637b70478b7955e287fb Mon Sep 17 00:00:00 2001 From: drk Date: Mon, 4 Sep 2023 22:45:50 -0500 Subject: [PATCH 1/8] bugfix: added subReorg check on relayPh --- core/slice.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/slice.go b/core/slice.go index fdbc7eae59..1c73a916ec 100644 --- a/core/slice.go +++ b/core/slice.go @@ -359,7 +359,7 @@ func (sl *Slice) relayPh(block *types.Block, pendingHeaderWithTermini types.Pend } else { log.Warn("Pending Header for Best ph key does not exist", "best ph key", sl.bestPhKey) } - } else if !domOrigin { + } else if !domOrigin && subReorg { for _, i := range sl.randomRelayArray() { if sl.subClients[i] != nil { sl.subClients[i].SubRelayPendingHeader(context.Background(), pendingHeaderWithTermini, pendingHeaderWithTermini.Header().ParentEntropy(), location, subReorg) From 89ef5fd2e19c571add9b344b5779a796d48ca2b5 Mon Sep 17 00:00:00 2001 From: gop Date: Tue, 5 Sep 2023 11:24:53 -0500 Subject: [PATCH 2/8] bugfix: cannot have go routine on subrelay in updateDom --- core/slice.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/slice.go b/core/slice.go index 1c73a916ec..f7b0b34c17 100644 --- a/core/slice.go +++ b/core/slice.go @@ -416,7 +416,7 @@ func (sl *Slice) UpdateDom(oldTerminus common.Hash, newTerminus common.Hash, new log.Info("pendingHeaderWithTermini:", "parent Hash:", pendingHeaderWithTermini.Header().ParentHash(), "Number", pendingHeaderWithTermini.Header().NumberArray()) for _, i := range sl.randomRelayArray() { if sl.subClients[i] != nil { - go sl.subClients[i].SubRelayPendingHeader(context.Background(), pendingHeaderWithTermini, newEntropy, location, true) + sl.subClients[i].SubRelayPendingHeader(context.Background(), pendingHeaderWithTermini, newEntropy, location, true) } } } From 1c87e9978befa64a9694cd57226555dd45926c68 Mon Sep 17 00:00:00 2001 From: gop Date: Thu, 7 Sep 2023 22:20:52 -0500 Subject: [PATCH 3/8] bugfix: WriteBlock before Inserting the local mined block --- core/core.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/core.go b/core/core.go index 597d8a4606..854e6ecd2a 100644 --- a/core/core.go +++ b/core/core.go @@ -359,11 +359,12 @@ func (c *Core) WriteBlock(block *types.Block) { } nodeCtx := common.NodeLocation.Context() if order == nodeCtx { - c.addToAppendQueue(block) parentHeader := c.GetHeader(block.ParentHash(), block.NumberU64()-1) if parentHeader != nil { + c.sl.WriteBlock(block) c.InsertChain([]*types.Block{block}) } + c.addToAppendQueue(block) // If a dom block comes in and we havent appended it yet } else if order < nodeCtx && c.GetHeaderByHash(block.Hash()) == nil { if c.sl.domClient != nil { From 56a7c94677b9515d3163731d600c604cf1433d12 Mon Sep 17 00:00:00 2001 From: gop Date: Sat, 9 Sep 2023 17:43:43 -0500 Subject: [PATCH 4/8] bugfix: updated the futureblock dist from 15 to 100 --- core/core.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/core.go b/core/core.go index 854e6ecd2a..86c6d6e772 100644 --- a/core/core.go +++ b/core/core.go @@ -34,7 +34,7 @@ const ( c_primeRetryThreshold = 1800 // Number of times a block is retry to be appended before eviction from append queue in Prime c_regionRetryThreshold = 1200 // Number of times a block is retry to be appended before eviction from append queue in Region c_zoneRetryThreshold = 600 // Number of times a block is retry to be appended before eviction from append queue in Zone - c_maxFutureBlocks = 15 // Number of blocks ahead of the current block to be put in the hashNumberList + c_maxFutureBlocks = 100 // Number of blocks ahead of the current block to be put in the hashNumberList c_appendQueueRetryPriorityThreshold = 5 // If retry counter for a block is less than this number, then its put in the special list that is tried first to be appended c_appendQueueRemoveThreshold = 10 // Number of blocks behind the block should be from the current header to be eligble for removal from the append queue ) From 923c34d32a888be6eb9a6ecd7682963636e94724 Mon Sep 17 00:00:00 2001 From: drk Date: Mon, 4 Sep 2023 16:06:42 -0500 Subject: [PATCH 5/8] Use bestPh to pick inslice append phHeader --- core/slice.go | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/core/slice.go b/core/slice.go index f7b0b34c17..5e54ec563d 100644 --- a/core/slice.go +++ b/core/slice.go @@ -255,7 +255,12 @@ func (sl *Slice) Append(header *types.Header, domPendingHeader *types.Header, do time8 = common.PrettyDuration(time.Since(start)) - subReorg = sl.miningStrategy(bestPh, block) + tempPendingHeader, err := sl.generateSlicePendingHeader(block, newTermini, domPendingHeader, domOrigin, false, false) + if err != nil { + return nil, false, err + } + + subReorg = sl.miningStrategy(bestPh, tempPendingHeader) if order < nodeCtx { // Store the inbound etxs for dom blocks that did not get picked and use @@ -333,11 +338,11 @@ func (sl *Slice) Append(header *types.Header, domPendingHeader *types.Header, do return subPendingEtxs, subReorg, nil } } -func (sl *Slice) miningStrategy(bestPh types.PendingHeader, block *types.Block) bool { +func (sl *Slice) miningStrategy(bestPh types.PendingHeader, pendingHeader types.PendingHeader) bool { if bestPh.Header() == nil { // This is the case where we try to append the block before we have not initialized the bestPh return true } - subReorg := sl.poem(sl.engine.TotalLogS(block.Header()), bestPh.Header().ParentEntropy()) + subReorg := sl.poem(sl.engine.TotalLogPhS(pendingHeader.Header()), sl.engine.TotalLogPhS(bestPh.Header())) return subReorg } @@ -498,6 +503,14 @@ func (sl *Slice) generateSlicePendingHeader(block *types.Block, newTermini types localPendingHeader = types.EmptyHeader() localPendingHeader.SetParentHash(block.Hash(), nodeCtx) localPendingHeader.SetNumber(big.NewInt(int64(block.NumberU64()) + 1)) + localPendingHeader.SetParentEntropy(sl.engine.TotalLogS(block.Header())) + if nodeCtx != common.PRIME_CTX { + if domOrigin { + localPendingHeader.SetParentDeltaS(big.NewInt(0), nodeCtx) + } else { + localPendingHeader.SetParentDeltaS(sl.engine.DeltaLogS(block.Header()), nodeCtx) + } + } manifestHash := sl.miner.worker.ComputeManifestHash(block.Header()) localPendingHeader.SetManifestHash(manifestHash) From aabe04ff3d88e57814c69d2cc2f9f0c1423195fd Mon Sep 17 00:00:00 2001 From: gop Date: Sun, 10 Sep 2023 20:54:02 -0500 Subject: [PATCH 6/8] bugfix: Locking updatePhCacheFromDom and computing pending header Protecting the async updates --- core/slice.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/core/slice.go b/core/slice.go index 5e54ec563d..acd460dc7d 100644 --- a/core/slice.go +++ b/core/slice.go @@ -241,6 +241,9 @@ func (sl *Slice) Append(header *types.Header, domPendingHeader *types.Header, do time7 := common.PrettyDuration(time.Since(start)) + sl.phCacheMu.Lock() + defer sl.phCacheMu.Unlock() + var time8, time9 common.PrettyDuration var bestPh types.PendingHeader var exist bool @@ -284,8 +287,6 @@ func (sl *Slice) Append(header *types.Header, domPendingHeader *types.Header, do time9 = common.PrettyDuration(time.Since(start)) } - sl.phCacheMu.Lock() - defer sl.phCacheMu.Unlock() sl.updatePhCache(pendingHeaderWithTermini, true, nil, subReorg) var updateDom bool @@ -731,6 +732,8 @@ func (sl *Slice) computePendingHeader(localPendingHeaderWithTermini types.Pendin // updatePhCacheFromDom combines the recieved pending header with the pending header stored locally at a given terminus for specified context func (sl *Slice) updatePhCacheFromDom(pendingHeader types.PendingHeader, terminiIndex int, indices []int, newEntropy *big.Int, subReorg bool) error { + sl.phCacheMu.Lock() + defer sl.phCacheMu.Unlock() hash := pendingHeader.Termini().SubTerminiAtIndex(terminiIndex) localPendingHeader, exists := sl.readPhCache(hash) @@ -744,9 +747,7 @@ func (sl *Slice) updatePhCacheFromDom(pendingHeader types.PendingHeader, termini nodeCtx := common.NodeLocation.Context() if nodeCtx == common.ZONE_CTX && exists && sl.bestPhKey != localPendingHeader.Termini().DomTerminus() && !sl.poem(newEntropy, bestPh.Header().ParentEntropy()) { log.Info("subrelay rejected", "local dom terminus", localPendingHeader.Termini().DomTerminus(), "Number", localPendingHeader.Header().NumberArray(), "best ph key", sl.bestPhKey, "number", bestPh.Header().NumberArray(), "newentropy", newEntropy) - sl.phCacheMu.Lock() sl.updatePhCache(types.NewPendingHeader(combinedPendingHeader, localPendingHeader.Termini()), false, nil, sl.poem(newEntropy, localPendingHeader.Header().ParentEntropy())) - sl.phCacheMu.Unlock() go sl.domClient.UpdateDom(context.Background(), localPendingHeader.Termini().DomTerminus(), sl.bestPhKey, bestPh.Header().ParentEntropy(), common.NodeLocation) return nil } @@ -793,9 +794,7 @@ func (sl *Slice) updatePhCacheFromDom(pendingHeader types.PendingHeader, termini } } - sl.phCacheMu.Lock() sl.updatePhCache(types.NewPendingHeader(combinedPendingHeader, localPendingHeader.Termini()), false, nil, subReorg) - sl.phCacheMu.Unlock() return nil } @@ -819,7 +818,7 @@ func (sl *Slice) updatePhCache(pendingHeaderWithTermini types.PendingHeader, inS if !exists { return } - if !sl.poem(pendingHeaderWithTermini.Header().ParentEntropy(), bestPh.Header().ParentEntropy()) { + if !sl.miningStrategy(bestPh, pendingHeaderWithTermini) { return } } From ae4e089df7d907ad25a862eb10423dd2cc360f83 Mon Sep 17 00:00:00 2001 From: gop Date: Fri, 8 Sep 2023 10:18:32 -0500 Subject: [PATCH 7/8] Added location information in the Appended print --- core/slice.go | 1 + 1 file changed, 1 insertion(+) diff --git a/core/slice.go b/core/slice.go index acd460dc7d..a1460a74ef 100644 --- a/core/slice.go +++ b/core/slice.go @@ -325,6 +325,7 @@ func (sl *Slice) Append(header *types.Header, domPendingHeader *types.Header, do "uncles", len(block.Uncles()), "txs", len(block.Transactions()), "etxs", len(block.ExtTransactions()), "gas", block.GasUsed(), "root", block.Root(), "order", order, + "location", block.Header().Location(), "elapsed", common.PrettyDuration(time.Since(start))) if nodeCtx == common.ZONE_CTX { From ade281369c395e7bc58b9f60504dd8be14ed6807 Mon Sep 17 00:00:00 2001 From: drk Date: Sat, 9 Sep 2023 17:40:43 -0500 Subject: [PATCH 8/8] bugfix: UpdateDom no longer calculates, uses the pendingHeader given by the zone UpdateDom takes zone pending header as input rather than entropy --- core/core.go | 4 +-- core/slice.go | 48 +++++++++++++++--------------------- eth/api_backend.go | 4 +-- internal/quaiapi/backend.go | 2 +- internal/quaiapi/quai_api.go | 4 +-- quaiclient/quaiclient.go | 4 +-- 6 files changed, 29 insertions(+), 37 deletions(-) diff --git a/core/core.go b/core/core.go index 86c6d6e772..dbb9234a1b 100644 --- a/core/core.go +++ b/core/core.go @@ -396,8 +396,8 @@ func (c *Core) SubRelayPendingHeader(slPendingHeader types.PendingHeader, newEnt c.sl.SubRelayPendingHeader(slPendingHeader, newEntropy, location, subReorg) } -func (c *Core) UpdateDom(oldTerminus common.Hash, newTerminus common.Hash, newEntropy *big.Int, location common.Location) { - c.sl.UpdateDom(oldTerminus, newTerminus, newEntropy, location) +func (c *Core) UpdateDom(oldTerminus common.Hash, newTerminus common.Hash, pendingHeader *types.Header, location common.Location) { + c.sl.UpdateDom(oldTerminus, newTerminus, pendingHeader, location) } func (c *Core) NewGenesisPendigHeader(pendingHeader *types.Header) { diff --git a/core/slice.go b/core/slice.go index a1460a74ef..8978bfa08c 100644 --- a/core/slice.go +++ b/core/slice.go @@ -332,7 +332,7 @@ func (sl *Slice) Append(header *types.Header, domPendingHeader *types.Header, do if updateDom { log.Info("Append updateDom", "oldTermini():", bestPh.Termini().DomTerminus(), "newTermini():", pendingHeaderWithTermini.Termini().DomTerminus(), "location:", common.NodeLocation) if sl.domClient != nil { - go sl.domClient.UpdateDom(context.Background(), bestPh.Termini().DomTerminus(), pendingHeaderWithTermini.Termini().DomTerminus(), pendingHeaderWithTermini.Header().ParentEntropy(), common.NodeLocation) + go sl.domClient.UpdateDom(context.Background(), bestPh.Termini().DomTerminus(), pendingHeaderWithTermini.Termini().DomTerminus(), pendingHeaderWithTermini.Header(), common.NodeLocation) } } return block.ExtTransactions(), subReorg, nil @@ -377,7 +377,7 @@ func (sl *Slice) relayPh(block *types.Block, pendingHeaderWithTermini types.Pend // If a zone changes its best ph key on a dom block, it sends a signal to the // dom and we can relay that information to the coords, to build on the right dom header -func (sl *Slice) UpdateDom(oldTerminus common.Hash, newTerminus common.Hash, newEntropy *big.Int, location common.Location) { +func (sl *Slice) UpdateDom(oldTerminus common.Hash, newTerminus common.Hash, pendingHeader *types.Header, location common.Location) { nodeCtx := common.NodeLocation.Context() sl.phCacheMu.Lock() defer sl.phCacheMu.Unlock() @@ -391,18 +391,12 @@ func (sl *Slice) UpdateDom(oldTerminus common.Hash, newTerminus common.Hash, new log.Info("UpdateDom:", "oldTerminus:", oldTerminus, "newTerminus:", newTerminus, "oldDomTerminus:", oldDomTermini.DomTerminus(), "newDomTerminus:", newDomTermini.DomTerminus()) if nodeCtx == common.REGION_CTX && oldDomTermini.DomTerminus() == newDomTermini.DomTerminus() { // Can update - block := sl.hc.GetBlockByHash(newTerminus) + newPh := types.NewPendingHeader(pendingHeader, *newDomTermini) sl.bestPhKey = newTerminus - if block != nil { - pendingHeaderWithTermini, err := sl.generateSlicePendingHeader(block, *newDomTermini, types.EmptyHeader(), false, true, false) - if err != nil { - return - } - log.Info("pendingHeaderWithTermini:", "parent Hash:", pendingHeaderWithTermini.Header().ParentHash(), "Number", pendingHeaderWithTermini.Header().NumberArray()) - for _, i := range sl.randomRelayArray() { - if sl.subClients[i] != nil { - sl.subClients[i].SubRelayPendingHeader(context.Background(), pendingHeaderWithTermini, newEntropy, common.Location{}, true) - } + log.Info("newPh:", "parent Hash:", newPh.Header().ParentHash(), "Number", newPh.Header().NumberArray()) + for _, i := range sl.randomRelayArray() { + if sl.subClients[i] != nil { + sl.subClients[i].SubRelayPendingHeader(context.Background(), newPh, pendingHeader.ParentEntropy(common.ZONE_CTX), common.Location{}, true) } } return @@ -410,21 +404,15 @@ func (sl *Slice) UpdateDom(oldTerminus common.Hash, newTerminus common.Hash, new // need to update dom log.Info("Append need to updateDom", "oldDomTermini:", oldDomTermini, "newDomTermini:", newDomTermini, "location:", common.NodeLocation) if sl.domClient != nil { - go sl.domClient.UpdateDom(context.Background(), oldDomTermini.DomTerminus(), newDomTermini.DomTerminus(), newEntropy, location) + go sl.domClient.UpdateDom(context.Background(), oldDomTermini.DomTerminus(), newDomTermini.DomTerminus(), pendingHeader, location) } else { // Can update - block := sl.hc.GetBlockByHash(newTerminus) + newPh := types.NewPendingHeader(pendingHeader, *newDomTermini) sl.bestPhKey = newTerminus - if block != nil { - pendingHeaderWithTermini, err := sl.generateSlicePendingHeader(block, *newDomTermini, types.EmptyHeader(), false, true, false) - if err != nil { - return - } - log.Info("pendingHeaderWithTermini:", "parent Hash:", pendingHeaderWithTermini.Header().ParentHash(), "Number", pendingHeaderWithTermini.Header().NumberArray()) - for _, i := range sl.randomRelayArray() { - if sl.subClients[i] != nil { - sl.subClients[i].SubRelayPendingHeader(context.Background(), pendingHeaderWithTermini, newEntropy, location, true) - } + log.Info("newPh:", "parent Hash:", newPh.Header().ParentHash(), "Number", newPh.Header().NumberArray()) + for _, i := range sl.randomRelayArray() { + if sl.subClients[i] != nil { + sl.subClients[i].SubRelayPendingHeader(context.Background(), newPh, pendingHeader.ParentEntropy(common.ZONE_CTX), common.Location{}, true) } } return @@ -720,6 +708,10 @@ func (sl *Slice) computePendingHeader(localPendingHeaderWithTermini types.Pendin var newPh *types.Header if exists { + if domOrigin { + newPh = sl.combinePendingHeader(localPendingHeaderWithTermini.Header(), domPendingHeader, nodeCtx, true) + return types.NewPendingHeader(types.CopyHeader(newPh), localPendingHeaderWithTermini.Termini()) + } newPh = sl.combinePendingHeader(localPendingHeaderWithTermini.Header(), cachedPendingHeaderWithTermini.Header(), nodeCtx, true) return types.NewPendingHeader(types.CopyHeader(newPh), localPendingHeaderWithTermini.Termini()) } else { @@ -747,9 +739,9 @@ func (sl *Slice) updatePhCacheFromDom(pendingHeader types.PendingHeader, termini bestPh, exists := sl.readPhCache(sl.bestPhKey) nodeCtx := common.NodeLocation.Context() if nodeCtx == common.ZONE_CTX && exists && sl.bestPhKey != localPendingHeader.Termini().DomTerminus() && !sl.poem(newEntropy, bestPh.Header().ParentEntropy()) { - log.Info("subrelay rejected", "local dom terminus", localPendingHeader.Termini().DomTerminus(), "Number", localPendingHeader.Header().NumberArray(), "best ph key", sl.bestPhKey, "number", bestPh.Header().NumberArray(), "newentropy", newEntropy) + log.Info("subrelay rejected", "local dom terminus", localPendingHeader.Termini().DomTerminus(), "Number", combinedPendingHeader.NumberArray(), "best ph key", sl.bestPhKey, "number", bestPh.Header().NumberArray(), "newentropy", newEntropy) sl.updatePhCache(types.NewPendingHeader(combinedPendingHeader, localPendingHeader.Termini()), false, nil, sl.poem(newEntropy, localPendingHeader.Header().ParentEntropy())) - go sl.domClient.UpdateDom(context.Background(), localPendingHeader.Termini().DomTerminus(), sl.bestPhKey, bestPh.Header().ParentEntropy(), common.NodeLocation) + go sl.domClient.UpdateDom(context.Background(), localPendingHeader.Termini().DomTerminus(), sl.bestPhKey, bestPh.Header(), common.NodeLocation) return nil } // Pick the head @@ -762,7 +754,7 @@ func (sl *Slice) updatePhCacheFromDom(pendingHeader types.PendingHeader, termini log.Error("Error setting current header", "err", err, "Hash", block.Hash()) return err } - log.Info("Choosing phHeader pickPhHead:", "NumberArray:", localPendingHeader.Header().NumberArray(), "Number:", localPendingHeader.Header().Number(), "ParentHash:", localPendingHeader.Header().ParentHash(), "Terminus:", localPendingHeader.Termini().DomTerminus()) + log.Info("Choosing phHeader pickPhHead:", "NumberArray:", combinedPendingHeader.NumberArray(), "Number:", combinedPendingHeader.Number(), "ParentHash:", combinedPendingHeader.ParentHash(), "Terminus:", localPendingHeader.Termini().DomTerminus()) sl.bestPhKey = localPendingHeader.Termini().DomTerminus() if block.Hash() != sl.hc.CurrentHeader().Hash() { sl.hc.chainHeadFeed.Send(ChainHeadEvent{block}) diff --git a/eth/api_backend.go b/eth/api_backend.go index 69a91fd6d1..0b51d952a1 100644 --- a/eth/api_backend.go +++ b/eth/api_backend.go @@ -472,8 +472,8 @@ func (b *QuaiAPIBackend) SubRelayPendingHeader(pendingHeader types.PendingHeader b.eth.core.SubRelayPendingHeader(pendingHeader, newEntropy, location, subReorg) } -func (b *QuaiAPIBackend) UpdateDom(oldTerminus common.Hash, newTerminus common.Hash, newEntropy *big.Int, location common.Location) { - b.eth.core.UpdateDom(oldTerminus, newTerminus, newEntropy, location) +func (b *QuaiAPIBackend) UpdateDom(oldTerminus common.Hash, newTerminus common.Hash, pendingHeader *types.Header, location common.Location) { + b.eth.core.UpdateDom(oldTerminus, newTerminus, pendingHeader, location) } func (b *QuaiAPIBackend) RequestDomToAppendOrFetch(hash common.Hash, order int) { diff --git a/internal/quaiapi/backend.go b/internal/quaiapi/backend.go index 58f56177bb..563c17a487 100644 --- a/internal/quaiapi/backend.go +++ b/internal/quaiapi/backend.go @@ -77,7 +77,7 @@ type Backend interface { InsertBlock(ctx context.Context, block *types.Block) (int, error) PendingBlock() *types.Block SubRelayPendingHeader(pendingHeader types.PendingHeader, newEntropy *big.Int, location common.Location, subReorg bool) - UpdateDom(oldTerminus common.Hash, newTerminus common.Hash, newEntropy *big.Int, location common.Location) + UpdateDom(oldTerminus common.Hash, newTerminus common.Hash, pendingHeader *types.Header, location common.Location) RequestDomToAppendOrFetch(hash common.Hash, order int) NewGenesisPendingHeader(pendingHeader *types.Header) GetPendingHeader() (*types.Header, error) diff --git a/internal/quaiapi/quai_api.go b/internal/quaiapi/quai_api.go index c1466ef801..26192e34d8 100644 --- a/internal/quaiapi/quai_api.go +++ b/internal/quaiapi/quai_api.go @@ -667,7 +667,7 @@ type DomUpdate struct { OldTerminus common.Hash NewTerminus common.Hash Location common.Location - NewEntropy *big.Int + Header *types.Header } func (s *PublicBlockChainQuaiAPI) UpdateDom(ctx context.Context, raw json.RawMessage) { @@ -677,7 +677,7 @@ func (s *PublicBlockChainQuaiAPI) UpdateDom(ctx context.Context, raw json.RawMes return } - s.b.UpdateDom(domUpdate.OldTerminus, domUpdate.NewTerminus, domUpdate.NewEntropy, domUpdate.Location) + s.b.UpdateDom(domUpdate.OldTerminus, domUpdate.NewTerminus, domUpdate.Header, domUpdate.Location) } type RequestDomToAppendOrFetchArgs struct { diff --git a/quaiclient/quaiclient.go b/quaiclient/quaiclient.go index 40d9850c29..8f66a65891 100644 --- a/quaiclient/quaiclient.go +++ b/quaiclient/quaiclient.go @@ -122,11 +122,11 @@ func (ec *Client) SubRelayPendingHeader(ctx context.Context, pendingHeader types ec.c.CallContext(ctx, nil, "quai_subRelayPendingHeader", data) } -func (ec *Client) UpdateDom(ctx context.Context, oldTerminus common.Hash, newTerminus common.Hash, newEntropy *big.Int, location common.Location) { +func (ec *Client) UpdateDom(ctx context.Context, oldTerminus common.Hash, newTerminus common.Hash, pendingHeader *types.Header, location common.Location) { data := map[string]interface{}{"OldTerminus": oldTerminus} data["NewTerminus"] = newTerminus data["Location"] = location - data["NewEntropy"] = newEntropy + data["Header"] = pendingHeader.RPCMarshalHeader() ec.c.CallContext(ctx, nil, "quai_updateDom", data) }