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

Block Header Modification #1

Closed
alanorwick opened this issue Aug 4, 2021 · 0 comments · Fixed by #16 or #18
Closed

Block Header Modification #1

alanorwick opened this issue Aug 4, 2021 · 0 comments · Fixed by #16 or #18
Assignees
Labels
enhancement New feature or request

Comments

@alanorwick
Copy link
Contributor

Quai block headers must be updated to the following:

type Header struct {
    ParentHash  []common.Hash    `json:"parentHash"       gencodec:"required"`
    UncleHash   []common.Hash    `json:"sha3Uncles"       gencodec:"required"`
    Coinbase    []common.Address `json:"miner"            gencodec:"required"`
    Root        []common.Hash    `json:"stateRoot"        gencodec:"required"`
    TxHash      []common.Hash    `json:"transactionsRoot" gencodec:"required"`
    ReceiptHash []common.Hash    `json:"receiptsRoot"     gencodec:"required"`
    Bloom       []Bloom          `json:"logsBloom"        gencodec:"required"`
    Difficulty  []*big.Int       `json:"difficulty"       gencodec:"required"`
    Number      []*big.Int       `json:"number"           gencodec:"required"`
    GasLimit    uint64         `json:"gasLimit"         gencodec:"required"`
    GasUsed     uint64         `json:"gasUsed"          gencodec:"required"`
    Time        uint64         `json:"timestamp"        gencodec:"required"`
    Extra       []byte         `json:"extraData"        gencodec:"required"`
    MixDigest   common.Hash    `json:"mixHash"`
    Nonce       BlockNonce     `json:"nonce"`

    // BaseFee was added by EIP-1559 and is ignored in legacy headers.
    BaseFee *big.Int `json:"baseFeePerGas" rlp:"optional"`

    // New
    // Map the current Region / Zone 
    MapContext  []byte

    Location    []byte
}

In the following file:
https://github.com/spruce-solutions/go-quai/blob/0e2b90ec3f183c3112bc84e5d4db231a7454d52f/core/types/block.go#L73-L93

Tests that must be updated:
https://github.com/spruce-solutions/go-quai/blob/0e2b90ec3f183c3112bc84e5d4db231a7454d52f/core/types/block_test.go#L36
https://github.com/spruce-solutions/go-quai/blob/0e2b90ec3f183c3112bc84e5d4db231a7454d52f/core/types/block_test.go#L72
https://github.com/spruce-solutions/go-quai/blob/0e2b90ec3f183c3112bc84e5d4db231a7454d52f/core/types/block_test.go#L139
https://github.com/spruce-solutions/go-quai/blob/0e2b90ec3f183c3112bc84e5d4db231a7454d52f/core/types/block_test.go#L208
https://github.com/spruce-solutions/go-quai/blob/0e2b90ec3f183c3112bc84e5d4db231a7454d52f/core/types/block_test.go#L231

@alanorwick alanorwick changed the title Block Header Modification + Tests Block Header Modification Aug 4, 2021
@alanorwick alanorwick self-assigned this Aug 6, 2021
This was linked to pull requests Aug 9, 2021
@alanorwick alanorwick added the enhancement New feature or request label Aug 11, 2021
alejoacosta74 added a commit to alejoacosta74/go-quai that referenced this issue Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
1 participant