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

feat(prospective-parachains): handle GetMinimumRelayParents signal #4363

Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
afa3e68
feat: starting the fragment chain implementation
EclesioMeloJunior Nov 11, 2024
404f5fe
feat: implemented `CandidateStorage`
EclesioMeloJunior Nov 12, 2024
6648464
feat: create `Scope`, working on inclusionemulator.Fragment
EclesioMeloJunior Nov 13, 2024
5119649
wip: implementing `validateAgainstConstraints`
EclesioMeloJunior Nov 14, 2024
e072160
feat: implement `BackedChain`
EclesioMeloJunior Nov 14, 2024
0de059a
wip: `FragmentChain` struct implementation
EclesioMeloJunior Nov 15, 2024
0388b02
feat: full `FragmentChain` implementation done
EclesioMeloJunior Nov 16, 2024
1b796b8
chore: wip fragment chain tests
EclesioMeloJunior Nov 19, 2024
f11ee4f
chore: `TestPopulateAndCheckPotential` done
EclesioMeloJunior Nov 21, 2024
6a001c8
feat: bring polkadot-sdk test coverage to fragment chain
EclesioMeloJunior Nov 21, 2024
6b30bc6
chore: remove dsstore
EclesioMeloJunior Nov 26, 2024
5f01ccb
chore: change loopt
EclesioMeloJunior Nov 28, 2024
987c880
Merge branch 'feat/parachain' into eclesio/fragment-chain-impl
EclesioMeloJunior Nov 28, 2024
51a2de6
feat(prospective-parachains) handle GetMinimumRelayParents signal
DanielDDHM Dec 3, 2024
36e20f7
feat(prospective-parachains) handle GetMinimumRelayParents signal
DanielDDHM Dec 3, 2024
4e34f46
feat(prospective-parachains) handle GetMinimumRelayParents signal
DanielDDHM Dec 3, 2024
5abd1e3
chore: fix loop conditional
EclesioMeloJunior Dec 3, 2024
3663b63
Merge branch 'eclesio/fragment-chain-impl' into feature/add_handle_ge…
EclesioMeloJunior Dec 3, 2024
355b363
Update dot/parachain/prospective-parachains/prospective-parachains.go
DanielDDHM Dec 3, 2024
08e2288
feat(prospective-parachains) handle GetMinimumRelayParents signal
DanielDDHM Dec 3, 2024
136c189
feat(prospective-parachains) handle GetMinimumRelayParents signal
DanielDDHM Dec 4, 2024
837c251
feat(prospective-parachains) handle GetMinimumRelayParents signal
DanielDDHM Dec 4, 2024
4e1e9a4
feat(prospective-parachains) handle GetMinimumRelayParents signal
DanielDDHM Dec 5, 2024
a31d84a
feat(prospective-parachains) handle GetMinimumRelayParents signal
DanielDDHM Dec 5, 2024
54e0adb
chore: address comment
EclesioMeloJunior Dec 5, 2024
78dfef1
chore: address comments
EclesioMeloJunior Dec 6, 2024
e55b6ce
chore: test snakecase
EclesioMeloJunior Dec 6, 2024
2f60868
wip: fixing failing tests
EclesioMeloJunior Dec 6, 2024
1a9926b
Merge branch 'eclesio/fragment-chain-impl' into feature/add_handle_ge…
DanielDDHM Dec 6, 2024
041f161
chore: fix `TestScopeOnlyTakesAncestorsUpToMin` test
EclesioMeloJunior Dec 9, 2024
082bb9c
chore: loop until maxDepth + 1
EclesioMeloJunior Dec 9, 2024
153b7d6
Merge branch 'feat/parachain' into eclesio/fragment-chain-impl
EclesioMeloJunior Dec 9, 2024
7d716c7
chore: gofmt
EclesioMeloJunior Dec 9, 2024
1dfeb76
chore: address lint warns
EclesioMeloJunior Dec 9, 2024
ba8ede8
chore: removed `Unconnected` method
EclesioMeloJunior Dec 10, 2024
ef35ba9
chore: remove `candidates` method
EclesioMeloJunior Dec 10, 2024
6e28164
chore: added logs
EclesioMeloJunior Dec 10, 2024
b65841c
Merge branch 'feat/parachain' into eclesio/fragment-chain-impl
EclesioMeloJunior Dec 10, 2024
30062cf
chore: address comments
EclesioMeloJunior Dec 12, 2024
8d80d2d
Merge branch 'eclesio/fragment-chain-impl' of github.com:ChainSafe/go…
EclesioMeloJunior Dec 12, 2024
e484624
Merge branch 'feat/parachain' into eclesio/fragment-chain-impl
EclesioMeloJunior Dec 12, 2024
42a7345
chore: fix misspelling
EclesioMeloJunior Dec 12, 2024
87e096c
Merge branch 'eclesio/fragment-chain-impl' of github.com:ChainSafe/go…
EclesioMeloJunior Dec 12, 2024
71085e7
chore: make types unexported
EclesioMeloJunior Dec 12, 2024
873dab9
Merge branch 'eclesio/fragment-chain-impl' into feature/add_handle_ge…
DanielDDHM Dec 13, 2024
66bdb6a
feat(prospective-parachains) handle GetMinimumRelayParents signal
DanielDDHM Dec 13, 2024
da18a0b
Trigger Build
EclesioMeloJunior Dec 13, 2024
9b9f513
Merge branch 'eclesio/fragment-chain-impl' into feature/add_handle_ge…
DanielDDHM Dec 13, 2024
d16b056
chore: addressing comments
EclesioMeloJunior Dec 14, 2024
e5d8019
chore: small comments
EclesioMeloJunior Dec 14, 2024
e2a0908
Merge branch 'eclesio/fragment-chain-impl' into feature/add_handle_ge…
DanielDDHM Dec 16, 2024
6c4092a
feat(prospective-parachains) handle GetMinimumRelayParents signal
DanielDDHM Dec 16, 2024
14bed8b
feat(prospective-parachains) handle GetMinimumRelayParents signal
DanielDDHM Dec 16, 2024
1835388
Merge branch 'feat/parachain' into eclesio/fragment-chain-impl
EclesioMeloJunior Jan 6, 2025
ee66827
chore: adjust types
EclesioMeloJunior Jan 6, 2025
3ba5603
chore: nolint unused funcs
EclesioMeloJunior Jan 6, 2025
f4985da
Merge branch 'eclesio/fragment-chain-impl' into feature/add_handle_ge…
DanielDDHM Jan 8, 2025
7f5ffe0
feat(prospective-parachains) fix lint
DanielDDHM Jan 8, 2025
46ecf17
feat(prospective-parachains) fix file name
DanielDDHM Jan 8, 2025
93a1250
Merge branch 'feat/parachain' into feature/add_handle_get_minimum_rel…
DanielDDHM Jan 8, 2025
c0e2c90
feat(prospective-parachains) fix private method
DanielDDHM Jan 8, 2025
d48a0b9
feat(prospective-parachains) fix test
DanielDDHM Jan 10, 2025
6f4626d
Merge branch 'feat/parachain' into feature/add_handle_get_minimum_rel…
DanielDDHM Jan 14, 2025
6dfc8c7
feat(prospective-parachains) fix test
DanielDDHM Jan 14, 2025
8fccb47
Merge branch 'feat/parachain' into feature/add_handle_get_minimum_rel…
EclesioMeloJunior Jan 14, 2025
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
82 changes: 82 additions & 0 deletions dot/parachain/prospective-parachains/fragment-chain/errors.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
package fragmentchain

import (
"errors"
"fmt"

parachaintypes "github.com/ChainSafe/gossamer/dot/parachain/types"
"github.com/ChainSafe/gossamer/lib/common"
)

var (
ErrCandidateAlradyKnown = errors.New("candidate already known")
ErrZeroLengthCycle = errors.New("candidate's parent head is equal to its output head. Would introduce a cycle")
ErrCycle = errors.New("candidate would introduce a cycle")
ErrMultiplePaths = errors.New("candidate would introduce two paths to the same output state")
ErrIntroduceBackedCandidate = errors.New("attempting to directly introduce a Backed candidate. It should first be introduced as Seconded")
ErrParentCandidateNotFound = errors.New("could not find parent of the candidate")
ErrRelayParentMovedBackwards = errors.New("relay parent would move backwards from the latest candidate in the chain")
ErrPersistedValidationDataMismatch = errors.New("candidate does not match the persisted validation data provided alongside it")
ErrCandidateEntryZeroLengthCycle = errors.New("candidate's parent head is equal to its output head. Would introduce a cycle")
)

type ErrRelayParentPrecedesCandidatePendingAvailability struct {
relayParentA, relayParentB common.Hash
}

func (e ErrRelayParentPrecedesCandidatePendingAvailability) Error() string {
return fmt.Sprintf("relay parent %x of the candidate precedes the relay parent %x of a pending availability candidate",
e.relayParentA, e.relayParentB)
}

type ErrForkWithCandidatePendingAvailability struct {
candidateHash parachaintypes.CandidateHash
}

func (e ErrForkWithCandidatePendingAvailability) Error() string {
return fmt.Sprintf("candidate would introduce a fork with a pending availability candidate: %x", e.candidateHash.Value)
}

type ErrForkChoiceRule struct {
candidateHash parachaintypes.CandidateHash
}

func (e ErrForkChoiceRule) Error() string {
return fmt.Sprintf("fork selection rule favours another candidate: %x", e.candidateHash.Value)
}

type ErrComputeConstraints struct {
modificationErr error
}

func (e ErrComputeConstraints) Error() string {
return fmt.Sprintf("could not compute candidate constraints: %s", e.modificationErr)
}

type ErrCheckAgainstConstraints struct {
fragmentValidityErr error
}

func (e ErrCheckAgainstConstraints) Error() string {
return fmt.Sprintf("candidate violates constraints: %s", e.fragmentValidityErr)
}

type ErrRelayParentNotInScope struct {
relayParentA, relayParentB common.Hash
}

func (e ErrRelayParentNotInScope) Error() string {
return fmt.Sprintf("relay parent %s not in scope, earliest relay parent allowed %s",
e.relayParentA.String(), e.relayParentB.String())
}

type ErrUnexpectedAncestor struct {
// The block number that this error occurred at
Number uint
// The previous seen block number, which did not match `number`.
Prev uint
}

func (e ErrUnexpectedAncestor) Error() string {
return fmt.Sprintf("unexpected ancestor %d, expected %d", e.Number, e.Prev)
}
Loading