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

Replace GoF with confirmation state #2313

Merged
merged 335 commits into from
Jul 7, 2022
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
335 commits
Select commit Hold shift + click to select a range
b6b7985
Feat: proper getters and setters for storables
karimodm Jun 8, 2022
947d77f
Add TODOs
karimodm Jun 8, 2022
08588d9
Merge branch 'feat/epoch-commitment' into feat/update-ec-structure
daria305 Jun 8, 2022
b25558f
Merge remote-tracking branch 'origin/develop' into feat/epoch-commitment
karimodm Jun 8, 2022
87f9a51
Fix: using new models after merge
karimodm Jun 8, 2022
da505cd
Fix: no compile errors
karimodm Jun 8, 2022
bb51d3e
Fix: storage nil pointer dereference
karimodm Jun 8, 2022
fc8307d
Add commitments progressing when delayed
daria305 Jun 9, 2022
42ffd22
Merge branch 'feat/epoch-commitment' into feat/update-ec-structure
daria305 Jun 9, 2022
6b0cf8a
Add comments to exported methods
jkrvivian Jun 9, 2022
cd1e8b5
Only have one MinMana threshold
karimodm Jun 9, 2022
079a005
Merge branch 'feat/epoch-commitment' of github.com:iotaledger/goshimm…
karimodm Jun 9, 2022
4380699
Change load snapshot logic for mana
georgysavva Jun 9, 2022
c51273d
Make epoch indeces persistent
karimodm Jun 9, 2022
39df69f
Add mana state root
daria305 Jun 9, 2022
3990932
Remove ecc
daria305 Jun 9, 2022
a5e12de
Use CachedECRecord
karimodm Jun 9, 2022
928d349
Merge branch 'feat/epoch-commitment' into feat/add-mana-root
daria305 Jun 9, 2022
f43fb1b
Merge branch 'feat/epoch-commitment' into snapshot-mana-epochs
georgysavva Jun 9, 2022
37ce2a5
Fix merge conflicts
georgysavva Jun 9, 2022
a3bb2f3
Fic EpochDiff definition
georgysavva Jun 9, 2022
3e73aff
Remove mana leaf if balance is 0
daria305 Jun 9, 2022
8ebc0b3
Remove EpochCommitment struct & code duplication
karimodm Jun 9, 2022
a6ae03c
Store latest ECRecord from snapshot
karimodm Jun 9, 2022
07321b7
Merge branch 'feat/epoch-commitment' into snapshot-mana-epochs-genera…
karimodm Jun 9, 2022
22da58f
Update packages/ledger/models.go
georgysavva Jun 9, 2022
7688260
EpochDiff now in ledger package to avoid cycles
karimodm Jun 9, 2022
df6971e
Merge branch 'snapshot-mana-epochs' of github.com:iotaledger/goshimme…
karimodm Jun 9, 2022
3825f8e
Genesis Snapshot Generation
karimodm Jun 9, 2022
840e65f
Merge branch 'feat/epoch-commitment' into feat/add-mana-root
daria305 Jun 9, 2022
d232ebd
AccessMana is now Mana1
karimodm Jun 9, 2022
42d174a
Remove references to --mana.snapshotResetTime=true
karimodm Jun 9, 2022
d546f29
Merge branch 'snapshot-mana-epochs' into feat/accessmana-mana1
karimodm Jun 9, 2022
03e9614
Remove references to --mana.snapshotResetTime=true
karimodm Jun 9, 2022
cda189a
Merge branch 'feat/accessmana-mana1' into feat/snapshot-mana-epochs-g…
karimodm Jun 9, 2022
090d5db
Fix some issues
karimodm Jun 9, 2022
fe263fb
Merge branch 'feat/epoch-commitment' into test-commitment
karimodm Jun 9, 2022
c12ebd6
Review fixes
georgysavva Jun 10, 2022
25beea7
Merge branch 'feat/epoch-commitment' into snapshot-mana-epochs
georgysavva Jun 10, 2022
0f65c0f
Genesis Snapshot Generation (#2266)
karimodm Jun 10, 2022
efdad0f
Remove OracleEpochShift
karimodm Jun 10, 2022
8247123
Fix: always initialize trees on new epoch
karimodm Jun 10, 2022
771763f
Working committments in messages
karimodm Jun 10, 2022
5ebe2e3
AccessMana is now Mana1 (#2267)
karimodm Jun 10, 2022
3a4a766
Add EC related variables to test framework
jkrvivian Jun 10, 2022
f4db46e
Add event mock structure for notarization manager
jkrvivian Jun 10, 2022
5dacd0e
Implement Tangle smt Tree test
jkrvivian Jun 10, 2022
0297231
EpochCommittment in dashboard
karimodm Jun 10, 2022
212cc2e
ECs finally in Messages
karimodm Jun 10, 2022
b56895c
Fixed dashboard LatestConfirmedEpoch glitch
karimodm Jun 10, 2022
938c22f
Fix: correctly compute PrevEC
karimodm Jun 10, 2022
96cc07c
Feat: include computed EC in dashboard
karimodm Jun 10, 2022
862dfae
Remove debugging prints
karimodm Jun 10, 2022
55bd58f
Merge branch 'feat/epoch-commitment' into test/notarization-manager
jkrvivian Jun 10, 2022
0ecbc6c
Update initialize with data method
georgysavva Jun 10, 2022
fe8023d
Snapshot
georgysavva Jun 10, 2022
87bf63a
Merge branch 'feat/epoch-commitment' into snapshot-mana-epochs
georgysavva Jun 10, 2022
832396f
Fix after merge
georgysavva Jun 10, 2022
bc7903c
Revert "Remove debugging prints"
karimodm Jun 10, 2022
dd0769c
Bump hive.go
karimodm Jun 11, 2022
25ddcf6
Several fixes
karimodm Jun 11, 2022
62d910c
Create snapshot in createGenesisOutputs
jkrvivian Jun 13, 2022
0ad47b9
Load snapshot and fix test
jkrvivian Jun 13, 2022
7e95967
Set up Tangle and issue messages
jkrvivian Jun 13, 2022
90b99f1
Fixes
jkrvivian Jun 13, 2022
b53e5b7
Fix a bunch of things
karimodm Jun 13, 2022
0c0111f
Merge pull request #2265 from iotaledger/snapshot-mana-epochs
karimodm Jun 13, 2022
120f372
Temporary Fix: epochdiff loading
karimodm Jun 13, 2022
0d702ab
Bypass finality gadget
jkrvivian Jun 14, 2022
2ff623e
Merge branch 'feat/epoch-commitment' into feat/add-mana-root
daria305 Jun 14, 2022
4c789b9
Fixes after merge
daria305 Jun 14, 2022
ad1dba2
Split EpochDiff storage & several fixes
karimodm Jun 14, 2022
946dfeb
Move store and load diff functions back to commitment factory
karimodm Jun 14, 2022
3fa3930
Update mana trees
daria305 Jun 15, 2022
6d1c636
Solve Update diff storage on inclusion todo
daria305 Jun 15, 2022
fff3aa5
Update diff on the message orphaned event if contain tx
daria305 Jun 15, 2022
2b999ac
Fix epochdiff storage
karimodm Jun 15, 2022
4f87ff4
Remove OnTransactionConfirmed in favor of OnTransactionInclusionUpdated
karimodm Jun 15, 2022
e6a8c0c
Merge remote-tracking branch 'origin/feat/add-mana-root' into feat/sp…
karimodm Jun 15, 2022
1c8f4d1
Rewrite test with TestScenario
jkrvivian Jun 15, 2022
c48bd04
Check CommitmentFunc error and committed epoch EI
jkrvivian Jun 16, 2022
d75d3c2
Working epoch committments with ManaRoot
karimodm Jun 16, 2022
a503124
Move proof stuff to its own file
karimodm Jun 16, 2022
196c418
Add state mutation and PCC tests
jkrvivian Jun 17, 2022
de0401b
Change mutation state test to non-conflicting txs scenario
jkrvivian Jun 17, 2022
2e6b32c
Add debug prints
jkrvivian Jun 17, 2022
db0f244
Remove some TODOs
karimodm Jun 17, 2022
fed2388
Addressed review
karimodm Jun 17, 2022
22c6260
Merge pull request #2291 from iotaledger/feat/split-epochdiff-storage
karimodm Jun 17, 2022
bb2b617
Fix: typos
karimodm Jun 17, 2022
a7e8b71
SnapshotDepth as notarization parameter
karimodm Jun 17, 2022
310fec2
Wire events from within notarization Manager
karimodm Jun 17, 2022
b13f3a0
Fix: do not shutdown Tangle twice
karimodm Jun 17, 2022
e4d4a88
Fix: removed unused mana snapshot
karimodm Jun 17, 2022
092951c
Dockerfile support go.work
karimodm Jun 17, 2022
2c1257e
Fix snapshot mana allocation for integration tests
karimodm Jun 17, 2022
d363d9e
Fix: mana test
karimodm Jun 17, 2022
180afbd
Merge branch 'feat/epoch-commitment' into test/notarization-manager
jkrvivian Jun 17, 2022
f86be7e
Fix Tangle tree test
jkrvivian Jun 20, 2022
e879c9f
Initialize ECRecord in new options
jkrvivian Jun 20, 2022
643fe73
Update State Mutation test to the latest changes
jkrvivian Jun 20, 2022
cd9ab89
Remove OnTransactionConfirmed
jkrvivian Jun 20, 2022
a3eb794
Fix some race conditions
karimodm Jun 20, 2022
d4f847f
Small improvement
karimodm Jun 20, 2022
ef266e8
Fix conflict Transaction Inclusion
karimodm Jun 20, 2022
9230360
Fix storage shutdown
karimodm Jun 20, 2022
953be01
Merge remote-tracking branch 'origin/develop' into fix/integration-tests
karimodm Jun 20, 2022
638c5ce
Fix common tests
karimodm Jun 20, 2022
a298075
Fix missing mana leaf startup error
karimodm Jun 20, 2022
72b4b13
Removed debugging prints
karimodm Jun 20, 2022
37cfcdf
Exported functions first
karimodm Jun 20, 2022
567182b
Fix: attachment might not be booked yet on BranchCreated
karimodm Jun 20, 2022
63d5a01
Use Tangle Time for old enough check
daria305 Jun 21, 2022
7d14eaf
Move Epoch Manager to epoch package
daria305 Jun 21, 2022
c7fe27c
Check if commitment tree exists before generating a proof
jkrvivian Jun 21, 2022
08595b9
Rename newEpochManager
daria305 Jun 21, 2022
641a08e
Fix snapshot creation in TestFramework
karimodm Jun 21, 2022
523d209
Epoch Commitments: fix bugs & integration tests #2297 from iotaledger…
karimodm Jun 21, 2022
58c6832
Merge remote-tracking branch 'origin/feat/epoch-commitment' into feat…
karimodm Jun 21, 2022
7fb2a8b
Merge remote-tracking branch 'origin/develop' into feat/merge-base-de…
karimodm Jun 21, 2022
7e68d36
Merge remote-tracking branch 'origin/test/notarization-manager' into …
karimodm Jun 21, 2022
27e904d
Fixes after merge
karimodm Jun 21, 2022
65f0dac
Merge remote-tracking branch 'origin/feat/epoch-commitment' into test…
karimodm Jun 21, 2022
056c62e
Fixes after merge
karimodm Jun 21, 2022
e83929f
Verify root and msgID/txID
jkrvivian Jun 21, 2022
ec1c29f
pkged.go
karimodm Jun 21, 2022
71d3d29
Disable notarization plugin on entrynode
karimodm Jun 21, 2022
a4e8fb1
Add next epoch started event
daria305 Jun 22, 2022
9b18abf
Merge branch 'feat/epoch-commitment' into feat/add-epoch-committable-…
daria305 Jun 22, 2022
fb409ee
Fix typo
daria305 Jun 22, 2022
b66987f
Remove unnecessary indexes from storage and add new
daria305 Jun 22, 2022
bdd9b9b
Fix and add conflicting test
jkrvivian Jun 22, 2022
1ed2211
Only treat Notarization events when node is bootstrapped
karimodm Jun 23, 2022
785e16c
Initialize aMana from snapshot without epoch delay
karimodm Jun 23, 2022
ce9eac1
Remove EpochManager as it is completely stateless
karimodm Jun 23, 2022
c0e9e86
Properly return or panic when error conditions are detected
karimodm Jun 23, 2022
f8bb143
Drop committmentTrees upon committing an epoch
karimodm Jun 23, 2022
01caec4
Book consensus mana in whole epochs
daria305 Jun 24, 2022
14d1b5a
Refactor testing framework set-up
jkrvivian Jun 24, 2022
2500836
Refactor assert functions
jkrvivian Jun 24, 2022
47d4b0a
Remove proofs code
karimodm Jun 24, 2022
fac32ec
Merge pull request #2310 from iotaledger/feat/epoch-commitment-fixes
karimodm Jun 24, 2022
35d873a
Merge remote-tracking branch 'origin/feat/epoch-commitment' into feat…
karimodm Jun 24, 2022
40c041e
Merge pull request #2309 from iotaledger/feat/move-epochmanager-to-epoch
karimodm Jun 24, 2022
33ebc9e
Ditch TestScenario in testing
jkrvivian Jun 24, 2022
b774ba3
Merge branch 'feat/merge-develop-into-epochs' into feat/epoch-commitment
karimodm Jun 24, 2022
3292b58
Merge remote-tracking branch 'origin/develop' into feat/epoch-commitment
karimodm Jun 24, 2022
e95dcdb
Merge pull request #2304 from iotaledger/feat/epoch-commitment-only-w…
karimodm Jun 24, 2022
f72181e
Merge branch 'feat/epoch-commitment' into feat/add-epoch-committable-…
daria305 Jun 24, 2022
8c85325
Clean up after merge
daria305 Jun 24, 2022
6b03bb7
Only trigger EpochCommitted if newly committed
karimodm Jun 24, 2022
a34277d
WIP: TestManager_DiffUTXOs
karimodm Jun 24, 2022
16d6cd8
Add TransactionInclusionUpdate test
jkrvivian Jun 24, 2022
64e3f04
Add assert diff store function
jkrvivian Jun 25, 2022
bd65e4e
Fix OutputWithMetadata model FromObjectStorage
karimodm Jun 26, 2022
16bd789
Merge branch 'test/notarization-manager' of github.com:iotaledger/gos…
karimodm Jun 26, 2022
73370ef
Fix: properly compact spent/created diff
karimodm Jun 26, 2022
5527fe7
Fix: async diffStorage shutdown in goroutine
karimodm Jun 26, 2022
ea76c9d
DiffUTXO test with reattachment
karimodm Jun 26, 2022
b094f02
Fix: isNew ecRecord
karimodm Jun 26, 2022
e32d180
DiffUTXO test with event expectation
karimodm Jun 26, 2022
da8bc45
Fix all notarization manager tests
karimodm Jun 26, 2022
31dee3f
OutputWithMetadata FromBytes with correct IDs
karimodm Jun 27, 2022
8f5d647
Merge remote-tracking branch 'origin/feat/epoch-commitment' into test…
karimodm Jun 27, 2022
0b21d7a
Some fixes after merge
karimodm Jun 27, 2022
6d30ad2
Compiles again
karimodm Jun 27, 2022
82ece8d
notarization tests passing
karimodm Jun 27, 2022
4b84f2b
Fix all the things!
karimodm Jun 27, 2022
86a8f41
Add bookEpoch test
daria305 Jun 27, 2022
05eeaf3
Fixes in tests
daria305 Jun 27, 2022
e12f721
Merge branch 'feat/epoch-commitment' into feat/add-epoch-committable-…
daria305 Jun 27, 2022
373e7ba
Fix Genesis snapshot loading with epoch 0
karimodm Jun 27, 2022
e6a1011
Use ATT time
daria305 Jun 27, 2022
ed908e8
Fix mManaVectorToUpdate event initialization
daria305 Jun 27, 2022
7b409cc
Remove --mana.snapshotResetTime=true from docker network compose
karimodm Jun 27, 2022
b5bffa0
Update packages/epoch/types.go
karimodm Jun 27, 2022
9e9180c
Address review
karimodm Jun 27, 2022
36b11ab
Merge branch 'test/notarization-manager' of github.com:iotaledger/gos…
karimodm Jun 27, 2022
233e79c
Update packages/notarization/manager.go
daria305 Jun 27, 2022
2fda38c
Apply review suggestions
daria305 Jun 28, 2022
04ba0c3
Merge remote-tracking branch 'origin/feat/add-epoch-committable-even'…
daria305 Jun 28, 2022
9e26820
Make diffs private
daria305 Jun 28, 2022
2287d1e
Fix: always check inclusionTime before triggering TransactionConfirme…
karimodm Jun 28, 2022
154172f
Remove unnecessary code
daria305 Jun 28, 2022
db3c51d
More fixes to bugs and tests
karimodm Jun 28, 2022
a482804
Merge branch 'test/notarization-manager' into feat/add-epoch-committa…
daria305 Jun 28, 2022
796e69e
Fix all tests
karimodm Jun 28, 2022
754b332
Remove prints
karimodm Jun 28, 2022
2ad8f30
Merge branch 'test/notarization-manager' into feat/add-epoch-committa…
daria305 Jun 28, 2022
16f0d20
Revert "Fix: always check inclusionTime before triggering Transaction…
karimodm Jun 28, 2022
b2562e1
Update commitments on new epoch event
daria305 Jun 28, 2022
34f35ee
txMeta.InclusionTime().IsZero() guard in OnTransactionConfirmed
karimodm Jun 28, 2022
3f387f9
Fix the indexes
daria305 Jun 28, 2022
1cce33e
Fix other unit tests
karimodm Jun 28, 2022
f9df532
Merge branch 'test/notarization-manager' into feat/add-epoch-committa…
daria305 Jun 29, 2022
04eae67
Fix TransactionConfirmed w/ InclusionTime
karimodm Jun 29, 2022
dd4e08d
Fix isCommittable condition, and race with ATT
daria305 Jun 29, 2022
4bee1c0
Fix most unit tests
daria305 Jun 29, 2022
ccc6ee9
Fix diff unittest
daria305 Jun 29, 2022
b73be48
Merge branch 'test/notarization-manager' into feat/add-epoch-committa…
daria305 Jun 29, 2022
dcafb04
Fix UpdateStateMutationTreeWithConflict unittest
daria305 Jun 29, 2022
23f559f
Trigger next epoch on AcceptanceTime updated
daria305 Jun 30, 2022
ba5e574
Advance epochs on ATT update: extend event to include ATT
karimodm Jun 30, 2022
d231efe
More unit test fixes
karimodm Jun 30, 2022
62c6c87
Remove check on Zero InclusionTime for Transactions
karimodm Jun 30, 2022
740ec58
Code quality
karimodm Jun 30, 2022
d09e326
Hook to ManaVectorUpdate from within mana plugin
karimodm Jun 30, 2022
10c517e
Fix BookEpoch test
daria305 Jun 30, 2022
0c2e82e
Code quality
karimodm Jun 30, 2022
c86e423
Fix TestPowFilter_Filter test
daria305 Jun 30, 2022
c16c509
Merge remote-tracking branch 'origin/feat/add-epoch-committable-even'…
daria305 Jun 30, 2022
14bd64d
Fix TestTangle_InvalidParentsAgeMessage
karimodm Jun 30, 2022
a56e061
Fix TestRateSetter_ErrorHandling test
daria305 Jun 30, 2022
e17ca9a
Merge remote-tracking branch 'origin/feat/add-epoch-committable-even'…
daria305 Jun 30, 2022
38cdc4e
Fix TestScheduler_SkipConfirmed test
daria305 Jun 30, 2022
f36e6b0
Fix TestScheduler_SkipConfirmed test
daria305 Jun 30, 2022
a21f832
Fix integration tests
karimodm Jun 30, 2022
1dd5ee0
Lock EpochCommittmentFactory upon OnAcceptanceTimeUpdated
karimodm Jun 30, 2022
a961773
ReadLock on GetLatestEC
karimodm Jun 30, 2022
264a437
Remove slow prints
karimodm Jun 30, 2022
63afe2c
Fresh GenesisTime
karimodm Jun 30, 2022
0a4a2d9
CMana calculation is now anchored to epochs
karimodm Jun 30, 2022
6ad7364
Fix: Set output pledgeID in booker
daria305 Jul 1, 2022
ff23c90
Merge remote-tracking branch 'origin/feat/add-epoch-committable-even'…
daria305 Jul 1, 2022
667f982
Fix: Set output pledgeID in booker
daria305 Jul 1, 2022
0edcfed
WIP mana tests
daria305 Jul 4, 2022
9dea252
Merge remote-tracking branch 'origin/feat/add-epoch-committable-even'…
daria305 Jul 4, 2022
5ef6ddb
Fix: Set output pledgeID in booker
daria305 Jul 1, 2022
f73b82d
Fix access mana pledge
daria305 Jul 4, 2022
e76f877
Fix invalid cast from MockedTransaction when storing outputs
karimodm Jul 4, 2022
8cc356d
Code quality
karimodm Jul 4, 2022
26655e3
Remove slow prints
karimodm Jul 4, 2022
95e6fef
Replace GoF with confirmation state
jonastheis Jul 5, 2022
f08320c
Merge remote-tracking branch 'origin/develop' into feat/confirmation-…
jonastheis Jul 5, 2022
9779835
Rename finality gadget to acceptance gadget
jonastheis Jul 5, 2022
3c7cbb4
Add Undefined confirmation state and add functionality for output con…
jonastheis Jul 5, 2022
c8bc6a7
Fix compile errors in integration tests
jonastheis Jul 5, 2022
2a048e0
Fix output confirmation state and consensus integration tests
jonastheis Jul 5, 2022
9a99019
Adjust dashboard and improve conflicts page
jonastheis Jul 6, 2022
056bad7
Remove GoF appearance throughout code base
jonastheis Jul 6, 2022
67d3411
Adjust dags visualizer
jonastheis Jul 6, 2022
6f5dfc0
Address review comments
jonastheis Jul 6, 2022
5061d6a
pkger
jonastheis Jul 6, 2022
5672e14
Fix integration mana_test
karimodm Jul 6, 2022
07964a8
Fix: epochs, mana booking and other fixes
karimodm Jul 6, 2022
3cdf2b7
Fix: all times above genesisTime are epoch 1
karimodm Jul 6, 2022
e0565b9
OutputWithMetadata now embeds used fields directly
karimodm Jul 6, 2022
577f8c7
Remove unused stuff
karimodm Jul 7, 2022
dcaac11
Fix output metadata snapshot load
karimodm Jul 7, 2022
82a118e
Fix: logging error
karimodm Jul 7, 2022
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
26 changes: 13 additions & 13 deletions client/evilwallet/connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
"time"

"github.com/iotaledger/hive.go/identity"
"github.com/iotaledger/hive.go/types/confirmation"

"github.com/iotaledger/goshimmer/client"
"github.com/iotaledger/goshimmer/client/wallet"
"github.com/iotaledger/goshimmer/packages/consensus/gof"
"github.com/iotaledger/goshimmer/packages/jsonmodels"
"github.com/iotaledger/goshimmer/packages/ledger/utxo"
"github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm"
Expand Down Expand Up @@ -179,12 +179,12 @@ type Client interface {
GetUnspentOutputForAddress(addr devnetvm.Address) *jsonmodels.WalletOutput
// GetAddressUnspentOutputs gets the unspent outputs of an address.
GetAddressUnspentOutputs(address string) (outputIDs []utxo.OutputID, err error)
// GetTransactionGoF returns the GoF of a given transaction ID.
GetTransactionGoF(txID string) gof.GradeOfFinality
// GetTransactionConfirmationState returns the ConfirmationState of a given transaction ID.
GetTransactionConfirmationState(txID string) confirmation.State
// GetOutput gets the output of a given outputID.
GetOutput(outputID utxo.OutputID) devnetvm.Output
// GetOutputGoF gets the first unspent outputs of a given address.
GetOutputGoF(outputID utxo.OutputID) gof.GradeOfFinality
// GetOutputConfirmationState gets the first unspent outputs of a given address.
GetOutputConfirmationState(outputID utxo.OutputID) confirmation.State
// BroadcastFaucetRequest requests funds from the faucet and returns the faucet request message ID.
BroadcastFaucetRequest(address string) error
// GetTransactionOutputs returns the outputs the transaction created.
Expand Down Expand Up @@ -288,14 +288,14 @@ func (c *WebClient) GetUnspentOutputForAddress(addr devnetvm.Address) *jsonmodel
return nil
}

// GetOutputGoF gets the first unspent outputs of a given address.
func (c *WebClient) GetOutputGoF(outputID utxo.OutputID) gof.GradeOfFinality {
// GetOutputConfirmationState gets the first unspent outputs of a given address.
func (c *WebClient) GetOutputConfirmationState(outputID utxo.OutputID) confirmation.State {
res, err := c.api.GetOutputMetadata(outputID.Base58())
if err != nil {
return gof.None
return confirmation.Pending
}

return res.GradeOfFinality
return res.ConfirmationState
}

// GetOutput gets the output of a given outputID.
Expand All @@ -308,13 +308,13 @@ func (c *WebClient) GetOutput(outputID utxo.OutputID) devnetvm.Output {
return output
}

// GetTransactionGoF returns the GoF of a given transaction ID.
func (c *WebClient) GetTransactionGoF(txID string) gof.GradeOfFinality {
// GetTransactionConfirmationState returns the ConfirmationState of a given transaction ID.
func (c *WebClient) GetTransactionConfirmationState(txID string) confirmation.State {
resp, err := c.api.GetTransactionMetadata(txID)
if err != nil {
return gof.None
return confirmation.Pending
}
return resp.GradeOfFinality
return resp.ConfirmationState
}

// GetTransactionOutputs returns the outputs the transaction created.
Expand Down
4 changes: 2 additions & 2 deletions client/evilwallet/output_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ func (o *OutputManager) AwaitOutputToBeConfirmed(outputID utxo.OutputID, waitFor
clt := o.connector.GetClient()
confirmed = false
for ; time.Since(s) < waitFor; time.Sleep(awaitConfirmationSleep) {
gof := clt.GetOutputGoF(outputID)
gof := clt.GetOutputConfirmationState(outputID)
if gof == GoFConfirmed {
confirmed = true
break
Expand Down Expand Up @@ -279,7 +279,7 @@ func (o *OutputManager) AwaitTransactionToBeConfirmed(txID string, waitFor time.
clt := o.connector.GetClient()
var confirmed bool
for ; time.Since(s) < waitFor; time.Sleep(awaitConfirmationSleep) {
if gof := clt.GetTransactionGoF(txID); gof == GoFConfirmed {
if gof := clt.GetTransactionConfirmationState(txID); gof == GoFConfirmed {
confirmed = true
break
}
Expand Down
5 changes: 3 additions & 2 deletions client/wallet/connector.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package wallet

import (
"github.com/iotaledger/hive.go/types/confirmation"

"github.com/iotaledger/goshimmer/client/wallet/packages/address"
"github.com/iotaledger/goshimmer/packages/consensus/gof"
"github.com/iotaledger/goshimmer/packages/ledger/utxo"
"github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm"
"github.com/iotaledger/goshimmer/packages/mana"
Expand All @@ -15,6 +16,6 @@ type Connector interface {
SendTransaction(transaction *devnetvm.Transaction) (err error)
RequestFaucetFunds(address address.Address, powTarget int) (err error)
GetAllowedPledgeIDs() (pledgeIDMap map[mana.Type][]string, err error)
GetTransactionGoF(txID utxo.TransactionID) (gradeOfFinality gof.GradeOfFinality, err error)
GetTransactionConfirmationState(txID utxo.TransactionID) (confirmationState confirmation.State, err error)
GetUnspentAliasOutput(address *devnetvm.AliasAddress) (output *devnetvm.AliasOutput, err error)
}
8 changes: 4 additions & 4 deletions client/wallet/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (

// Output is a wallet specific representation of an output in the IOTA network.
type Output struct {
Address address.Address
Object devnetvm.Output
Metadata OutputMetadata
GradeOfFinalityReached bool
Address address.Address
Object devnetvm.Output
Metadata OutputMetadata
ConfirmationStateReached bool
// Spent is a local wallet-only property that gets set once an output is spent from within the same wallet.
Spent bool
}
Expand Down
2 changes: 1 addition & 1 deletion client/wallet/output_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func (o *OutputManager) getOutputs(includePending bool, addresses ...address.Add
continue
}
// discard non-confirmed if includePending is false
if !includePending && !output.GradeOfFinalityReached {
if !includePending && !output.ConfirmationStateReached {
continue
}

Expand Down
18 changes: 9 additions & 9 deletions client/wallet/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/iotaledger/hive.go/generics/lo"
"github.com/iotaledger/hive.go/identity"
"github.com/iotaledger/hive.go/marshalutil"
"github.com/iotaledger/hive.go/types/confirmation"
"golang.org/x/crypto/blake2b"

"github.com/iotaledger/goshimmer/client/wallet/packages/address"
Expand All @@ -24,7 +25,6 @@ import (
"github.com/iotaledger/goshimmer/client/wallet/packages/sweepnftownedoptions"
"github.com/iotaledger/goshimmer/client/wallet/packages/transfernftoptions"
"github.com/iotaledger/goshimmer/client/wallet/packages/withdrawfromnftoptions"
"github.com/iotaledger/goshimmer/packages/consensus/gof"
"github.com/iotaledger/goshimmer/packages/ledger/utxo"
"github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm"
"github.com/iotaledger/goshimmer/packages/mana"
Expand Down Expand Up @@ -1412,7 +1412,7 @@ func (wallet *Wallet) Balance(refresh ...bool) (confirmedBalance, pendingBalance
for _, output := range outputsOnAddress {
// determine target map
var targetMap map[devnetvm.Color]uint64
if output.GradeOfFinalityReached {
if output.ConfirmationStateReached {
targetMap = confirmedBalance
} else {
targetMap = pendingBalance
Expand Down Expand Up @@ -1503,7 +1503,7 @@ func (wallet *Wallet) AvailableBalance(refresh ...bool) (confirmedBalance, pendi
for _, output := range outputsOnAddress {
// determine target map
var targetMap map[devnetvm.Color]uint64
if output.GradeOfFinalityReached {
if output.ConfirmationStateReached {
targetMap = confirmedBalance
} else {
targetMap = pendingBalance
Expand Down Expand Up @@ -1571,7 +1571,7 @@ func (wallet *Wallet) TimelockedBalances(refresh ...bool) (confirmed, pending Ti
Balance: casted.Balances().Map(),
Time: casted.TimeLock(),
}
if output.GradeOfFinalityReached {
if output.ConfirmationStateReached {
confirmed = append(confirmed, tBal)
} else {
pending = append(pending, tBal)
Expand Down Expand Up @@ -1618,7 +1618,7 @@ func (wallet *Wallet) ConditionalBalances(refresh ...bool) (confirmed, pending T
Balance: casted.Balances().Map(),
Time: fallbackDeadline,
}
if output.GradeOfFinalityReached {
if output.ConfirmationStateReached {
confirmed = append(confirmed, cBal)
} else {
pending = append(pending, cBal)
Expand Down Expand Up @@ -1666,7 +1666,7 @@ func (wallet *Wallet) AliasBalance(refresh ...bool) (
}
// target maps
var governedAliases, stateControlledAliases map[devnetvm.AliasAddress]*devnetvm.AliasOutput
if output.GradeOfFinalityReached {
if output.ConfirmationStateReached {
governedAliases = confirmedGovernedAliases
stateControlledAliases = confirmedStateControlledAliases
} else {
Expand Down Expand Up @@ -1764,7 +1764,7 @@ func (wallet *Wallet) DelegatedAliasBalance(refresh ...bool) (
}
// target maps
var delegatedAliases map[devnetvm.AliasAddress]*devnetvm.AliasOutput
if output.GradeOfFinalityReached {
if output.ConfirmationStateReached {
delegatedAliases = confirmedDelegatedAliases
} else {
delegatedAliases = pendingDelegatedAliases
Expand Down Expand Up @@ -1821,11 +1821,11 @@ func (wallet *Wallet) WaitForTxConfirmation(txID utxo.TransactionID) (err error)
for {
time.Sleep(wallet.ConfirmationPollInterval)
timeoutCounter += wallet.ConfirmationPollInterval
finality, fetchErr := wallet.connector.GetTransactionGoF(txID)
confirmationState, fetchErr := wallet.connector.GetTransactionConfirmationState(txID)
if fetchErr != nil {
return fetchErr
}
if finality == gof.High {
if confirmationState >= confirmation.Accepted {
return
}
if timeoutCounter > wallet.ConfirmationTimeout {
Expand Down
17 changes: 8 additions & 9 deletions client/wallet/webconnector.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package wallet

import (
"github.com/cockroachdb/errors"
"github.com/iotaledger/hive.go/types/confirmation"

"github.com/iotaledger/goshimmer/client"
"github.com/iotaledger/goshimmer/client/wallet/packages/address"
"github.com/iotaledger/goshimmer/packages/consensus/gof"
"github.com/iotaledger/goshimmer/packages/ledger/utxo"
"github.com/iotaledger/goshimmer/packages/ledger/vm/devnetvm"
"github.com/iotaledger/goshimmer/packages/mana"
Expand Down Expand Up @@ -83,10 +83,10 @@ func (webConnector WebConnector) UnspentOutputs(addresses ...address.Address) (u
}
// build output
walletOutput := &Output{
Address: addr,
Object: lOutput,
GradeOfFinalityReached: output.GradeOfFinality == gof.High,
Spent: false,
Address: addr,
Object: lOutput,
ConfirmationStateReached: output.ConfirmationState >= confirmation.Accepted,
Spent: false,
Metadata: OutputMetadata{
Timestamp: output.Metadata.Timestamp,
},
Expand Down Expand Up @@ -118,14 +118,13 @@ func (webConnector WebConnector) SendTransaction(tx *devnetvm.Transaction) (err
return
}

// GetTransactionGoF fetches the GoF of the transaction.
func (webConnector WebConnector) GetTransactionGoF(txID utxo.TransactionID) (gradeOfFinality gof.GradeOfFinality, err error) {
// GetTransactionConfirmationState fetches the ConfirmationState of the transaction.
func (webConnector WebConnector) GetTransactionConfirmationState(txID utxo.TransactionID) (confirmationState confirmation.State, err error) {
txmeta, err := webConnector.client.GetTransactionMetadata(txID.Base58())
if err != nil {
return
}
gradeOfFinality = txmeta.GradeOfFinality
return
return txmeta.ConfirmationState, nil
}

// GetAllowedPledgeIDs gets the list of nodeIDs that the node accepts as pledgeIDs in a transaction.
Expand Down
12 changes: 6 additions & 6 deletions documentation/docs/apis/ledgerstate.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ if err != nil {
}
fmt.Println("branch ID: ", resp.ID)
fmt.Println("branch type: ", resp.Type)
fmt.Println("branch inclusion state: ", resp.InclusionState)
fmt.Println("branch inclusion state: ", resp.ConfirmationState)
fmt.Println("branch parents IDs: ", resp.Parents)
fmt.Println("branch conflicts IDs: ", resp.ConflictIDs)
fmt.Printf("liked: %v, finalized: %v, monotonically liked: %v", resp.Liked, resp.Finalized, resp.MonotonicallyLiked)
Expand All @@ -290,7 +290,7 @@ fmt.Printf("liked: %v, finalized: %v, monotonically liked: %v", resp.Liked, resp
"liked": false,
"monotonicallyLiked": false,
"finalized": false,
"inclusionState": "InclusionState(Pending)"
"confirmationState": "ConfirmationState(Pending)"
}
```

Expand All @@ -304,7 +304,7 @@ fmt.Printf("liked: %v, finalized: %v, monotonically liked: %v", resp.Liked, resp
| `liked` | bool | The boolean indicator if branch is liked. |
| `monotonicallyLiked` | bool | The boolean indicator if branch is monotonically liked. |
| `finalized` | bool | The boolean indicator if branch is finalized. |
| `inclusionState` | string | Inclusion state of a branch. |
| `confirmationState` | string | Inclusion state of a branch. |
jonastheis marked this conversation as resolved.
Show resolved Hide resolved



Expand Down Expand Up @@ -1066,7 +1066,7 @@ for _, outputs := range resp.UnspentOutputs {
"address": "1Z4t5KEKU65fbeQCbNdztYTB1B4Cdxys1XRzTFrmvAf3"
}
},
"inclusionState": {
"confirmationState": {
"confirmed": true,
"rejected": false,
"conflicting": false
Expand Down Expand Up @@ -1105,7 +1105,7 @@ for _, outputs := range resp.UnspentOutputs {
|Field | Type | Description|
|:-----|:------|:------|
| `output` | Output | The unspent output. |
| `inclusionState`| InclusionState | The inclusion state of the transaction containing the output. |
| `confirmationState`| ConfirmationState | The inclusion state of the transaction containing the output. |
| `metadata`| WalletOutputMetadata | The metadata of the output for the wallet lib. |

#### Type `Output`
Expand All @@ -1124,7 +1124,7 @@ for _, outputs := range resp.UnspentOutputs {
| `transactionID` | string | The transaction identifier encoded with base58. |
| `outputIndex` | int | The index of an output. |

#### Type `InclusionState`
#### Type `ConfirmationState`

|Field | Type | Description|
|:-----|:------|:------|
Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/tutorials/send_transaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ If we use a wallet, this information will be available along with the wallet bal
```Go
resp, _ := goshimAPI.PostAddressUnspentOutputs([]string{myAddr.Base58()}) // ignoring error
for _, output := range resp.UnspentOutputs[0].Outputs {
fmt.Println("outputID:", output.Output.OutputID.Base58, "confirmed:", output.InclusionState.Confirmed)
fmt.Println("outputID:", output.Output.OutputID.Base58, "confirmed:", output.ConfirmationState.Confirmed)
}
```

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/gin-gonic/gin v1.7.0
github.com/go-resty/resty/v2 v2.6.0
github.com/gorilla/websocket v1.5.0
github.com/iotaledger/hive.go v0.0.0-20220617100616-12bd6f35b4a1
github.com/iotaledger/hive.go v0.0.0-20220623114907-44ff3c086a76
github.com/labstack/echo v3.3.10+incompatible
github.com/labstack/gommon v0.3.0
github.com/libp2p/go-libp2p v0.15.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,8 @@ github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANyt
github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo=
github.com/iotaledger/hive.go v0.0.0-20220617100616-12bd6f35b4a1 h1:7eOS9j+1K2M66OLgL/7tYafQIP9d0MMmyn0e72AmRUA=
github.com/iotaledger/hive.go v0.0.0-20220617100616-12bd6f35b4a1/go.mod h1:8f9U7qHFby0W3cxv/nKnz9LHn9BbwWU0tMsWDnfqzRI=
github.com/iotaledger/hive.go v0.0.0-20220623114907-44ff3c086a76 h1:FpDyFynhKHzWg+4zKgvhn10OOajgw+59SctnrDx5JUQ=
github.com/iotaledger/hive.go v0.0.0-20220623114907-44ff3c086a76/go.mod h1:8f9U7qHFby0W3cxv/nKnz9LHn9BbwWU0tMsWDnfqzRI=
github.com/ipfs/go-cid v0.0.1/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM=
github.com/ipfs/go-cid v0.0.2/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM=
github.com/ipfs/go-cid v0.0.3/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM=
Expand Down
Loading