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

server/asset/firo: block parsing for median fees #2488

Merged
merged 2 commits into from
Sep 7, 2023

Conversation

buck54321
Copy link
Member

@buck54321 buck54321 commented Aug 27, 2023

On testnet (v0.14.12.4), neither estimatefee nor estimatesmartfee give results, so we fall back to using median fees. Firo doesn't have getblockstats, so we have to do ManualMedianFee and scan blocks, but we didn't have a BlockFeeTransactions function set, so we were using the default wire.MsgBlock.Deserialize, which doesn't work for Firo. This made Firo unusable as a backend on testnet.

This doesn't appear to be a problem on mainnet (v0.14.12.1) or simnet (v0.14.12.4). Note that v0.14.12.4 shouldn't be run on mainnet

@dev-warrior777
Copy link
Contributor

I have asked @levonpetrosyan93 from 'firoorg' to comment

Comment on lines +292 to +294
// I have scanned the pre-ProgPOW sections of both testnet
// and mainnet and have yet to find non-zero HashRootMTP. I am
// speculating that the MTP proof data was purged in an upgrade
Copy link
Contributor

Choose a reason for hiding this comment

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

This is exactly correct. Later code purged unneeded MTP data.

r := bytes.NewReader(b)
blk := NewFiroBlock(net)
if err := blk.readBlockHeader(r); err != nil {
return nil, fmt.Errorf("readBlocHeader error: %v", err)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return nil, fmt.Errorf("readBlocHeader error: %v", err)
return nil, fmt.Errorf("readBlockHeader error: %v", err)

return nil, fmt.Errorf("ReadVarInt error: %v", err)
}
if _, err = io.CopyN(io.Discard, r, int64(sz)); err != nil {
return nil, fmt.Errorf("error discaring vExtraPayload: %v", err)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return nil, fmt.Errorf("error discaring vExtraPayload: %v", err)
return nil, fmt.Errorf("error discarding vExtraPayload: %v", err)

@buck54321 buck54321 merged commit fd38c5a into decred:master Sep 7, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants