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

Node transaction snapshots #1078

Merged
merged 49 commits into from
Jun 30, 2023

Conversation

esuwu
Copy link
Contributor

@esuwu esuwu commented Apr 19, 2023

No description provided.

@esuwu esuwu requested a review from nickeskov April 19, 2023 04:20
@nickeskov nickeskov added the wip This is a WIP, should not be merged right away label Apr 20, 2023
Comment on lines 137 to 144
for _, wb := range wavesBalancesSnapshot {
p := wb
transactionSnapshot = append(transactionSnapshot, &p)
}
for _, ab := range assetBalancesSnapshot {
p := ab
transactionSnapshot = append(transactionSnapshot, &p)
}
Copy link
Member

Choose a reason for hiding this comment

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

Please, pre-allocate memory for the result slice because you know the size.

And you also can rewrite it to this, this will save from unnecessary memory allocations:

for i := range wavesBalancesSnapshot {
	p := &wavesBalancesSnapshot[i]
	transactionSnapshot = append(transactionSnapshot, p)
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Comment on lines +559 to +562
// a temporary dummy for linters
if len(snapshot) > 1000 {
zap.S().Debug(snapshot)
}
Copy link
Member

Choose a reason for hiding this comment

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

Please, replace it with _ = initialSnapshot and add TODO.

Comment on lines +639 to +642
// a temporary dummy for linters
if len(initialSnapshot) > 100 {
zap.S().Debug(initialSnapshot)
}
Copy link
Member

Choose a reason for hiding this comment

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

And here

@esuwu esuwu merged commit 3eb1b86 into node-transactions-snapshots-types Jun 30, 2023
@nickeskov nickeskov deleted the node-transaction-snapshots branch October 30, 2023 13:38
nickeskov added a commit that referenced this pull request Nov 15, 2023
* Added types

* Renamed a file

* Changed asset- and waves balances structures

* Commented a function

* Changed addresses types

* Changed balanceAsset

* Added a constructor

* Added decimals to asset snapshot

* Changed uint8 to int8

* Added a field for asset reissuability

* Changed the type of total quantity

* removed the pointer

* Changed the type of orderID

* Make 'SnapshotManager' as an interface type.

* Replace 'proto.assetID' to 'crypto.Digest'.

* Replace 'proto.Address' to 'proto.WavesAddress'.

* Changed leaseID type

* changed types of leaseIn and leaseOut

* Removed the pointer types from AliasSnapshot

* Change a bit 'AtomicSnapshot' interface.

* Update snapshot types.

* Removed unnecessary fields in 'AccountScriptSnapshot' struct.

* Remove unnecessary types.

* Change 'StaticAssetInfoSnapshot.Issuer' field to 'StaticAssetInfoSnapshot.IssuerPublicKey'.

* Rename 'AssetReissuabilitySnapshot' to 'AssetVolumeSnapshot'.

* Add feature block reward distribution (#1082)

* add feature BlockRewardDistribution

* fix tests

* Improvement of the test on reward distribution to check that remainder of division goes to miner.

* refactor after rewiev

* fix feature info and add reward addresses in testnet and stagenet configs

* DAO and buyback addresses added for MainNet.
Formatting of settings files fixed.

---------

Co-authored-by: Alexey Kiselev <[email protected]>
Co-authored-by: Nikolay Eskov <[email protected]>

* change actions count with feature BlockRewardDistribution activated (#1088)

* change count actions with feature BlockRewardDistribution activated

* fix comment in script

* Merge fix.

* Fix version in comment

* Eth transaction refactoring and tests

---------

Co-authored-by: Alexey Kiselev <[email protected]>
Co-authored-by: Nikolay Eskov <[email protected]>

* Ride add rewards to block info (#1096)

* add feature BlockRewardDistribution

* fix tests

* Improvement of the test on reward distribution to check that remainder of division goes to miner.

* refactor after rewiev

* fix feature info and add reward addresses in testnet and stagenet configs

* change count actions with feature BlockRewardDistribution activated

* Ride version 7 added. Extended version of BlockInfo ride object added.
Ride types representation in objects stdlib description changed to simple string. Parsing of types added to code generation and updated in compiler.
Code generation updated to support Tuple types.

* Fixed code generation for RideV7. Fixed compilation of V7 scripts.
Added rewards structure and function to SmartState to get the block rewards.
Added test on script accessing new rewards field on BlockInfo.

* Fixed FunctionCall usage in tests

* Fixed sorting of rewards with stable sort.

* Script activation check added for RideV7.

* Code improvements

* Restored recursive check of list types in generated code.

* Generation of simplified code for tuple type checks.

* Duplicated tests removed

* Fixed lib version check in Ride compiler

---------

Co-authored-by: Anton Ilin <[email protected]>
Co-authored-by: Anton Ilin <[email protected]>

* Fix clear-text logging of sensitive information. (#1128)

* Bump golang.org/x/sync from 0.2.0 to 0.3.0 (#1129)

Bumps [golang.org/x/sync](https://github.com/golang/sync) from 0.2.0 to 0.3.0.
- [Commits](golang/sync@v0.2.0...v0.3.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sync
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alexey Kiselev <[email protected]>

* Added 'LeaseStateStatus'. Changed types in 'LeaseStateSnapshot'.

* Rename 'LeaseStateStatus.Status' to 'LeaseStateStatus.Value'.

* Add methods to 'SnapshotManager' interface. Changed 'AtomicSnapshot' interface.

* Snapshot applier (#1145)

* Create marshal/unmarshal methods for 'leasing' structure in 'pkg/state'.

* WIP: rollbackable map.

* Return 'balanceProfile' and 'wavesBalanceRecord' by value.

* Started 'snapshotApplier.'

* Add apply methods for assets snapshot applying.

* Add 'snapshotApplier.applySponsorship' method.

* Add 'snapshotApplier.applyAccountScript' method.

* Refactor 'ordersVolumes'.

* Add 'snapshotApplier.applyFilledVolumeAndFee' method.

* Add 'snapshotApplier.applyDataEntry' method.

* Add 'snapshotApplier.applyLeaseState' method.

* Revert "WIP: rollbackable map."

This reverts commit cb34969.

* Created and used 'SnapshotApplierInfo' interface in 'state' package.

* Create 'SnapshotApplier' interface in 'state' package.

* Refactor 'SnapshotApplier' interface.

* Remove 'SnapshotApplierInfo' interface.

* Extracted 'snapshotApplierStorages'.

* Rename 'ApplyDataEntry' to 'ApplyDataEntries'.

* Replace 'SnapshotManager' to 'SnapshotApplier'.

* Node transaction snapshots (#1078)

* Added a conversion function

* Added payment transaction conversion

* Added transfer tx conversion

* Transfer tx conversion changed

* Added issue and reissue tx conversions

* Issue

* Issue, reissue, burn, exchange

* Hanled lease transactions

* Finished performers

* Added snapshots for all types of transactions

* Fixed types after merging

* Fixed issue snapshot mistake

* Added rewards snapshot in append block

* Changed functions to newest

* Added snapshots from actions

* Removed todos

* Deleted useless code

* Fixed a mistake with leasing cancel

* Added tests for issue and reissue transactions

* Fixed tests

* fixed implicit memory aliasing

* Added tests for burn, lease, lease cancel, exchange and create alias transactions

* Added tests for data, sponsorship, set account and asset script transactions

* Added a test for the invoke transaction snapshots

* Fixed after merge

* Fixed a function

* Moved snapshot generation

* Remove 'SnapshotManager' interface.

* Added a todo

* Refactored perfomerInfo

* Refactored performer info again

* Moved generation to snapshot generator

* Fixed some linter issues

* Added an asset atomic snapshot for issue transaction

* Replaced current recording to storage to snapshot applier (#1162)

* Replaced current recording to storage to snapshot applier

* Replaced to snapshot applier, except balances

* Fixed a comment

* Removed the comment

* Removed unnecessary code

* Returned the linter command back

* Revert "Replaced current recording to storage to snapshot applier (#1162)" (#1164)

This reverts commit 51904b2.

* * Commented invoke snapshots, import ok (#1165)

* Replaced current recording to storage to snapshot applier

* Replaced to snapshot applier, except balances

* Fixed a comment

* Removed the comment

* Removed unnecessary code

* Returned the linter command back

* Added asset script atomic snapshot to the issue script actions

* Fixed some linter issues

* Fixed a few more linter issues

* Fixed all linter issues

* Fixed err shadowing

* Fixed a mistake with issue counter

* removed a useless line

* Fixed applying order transactions

* Fixed applying order transactions

* Added lising snapshot to the tx diff generated group

* Moved complexity saving into transaction performer

* Moved complexity saving into transaction performer

* removed a line

* Fixed a bug with an empty sender

* Used error.Is

* Set an empty script for issue with sig

* move snapshots types to proto

* Fixed a bug with wrong action sender

* Fixed a bug with wrong action sender

* Add 'TransactionStatusSnapshot'.

* Implemented 'AtomicSnapshot' interface for 'TransactionStatusSnapshot'.

* Changed 'AssetScriptSnapshot' and 'scriptStorageState.setAssetScript'.

Removed 'pk' arg from 'setAssetScript'.
Removed two fields from 'AssetScriptSnapshot':
- 'SenderPK'
- 'Complexity'

* * Commented invoke snapshots, import ok

* moved setting complexity and set script to snapshot applier

* Fixed a test and a mistake

* Fixed renaming

* Fixed a comment

* Moved dapp complexity to applier

* Added dapp complexity to set script as well

* Fixed a check mistake

* Fixed a test

* removed empty script check

* removed a todo

* Removed useless code

* Modified a test

* Fixed same keys issue for data entry actions

* Remove invoke snapshot (#1235)

* moved complexity back

* Reverted some changes, import ok

* Returned account script and asset script txs, import ?

* Uncommented internal snapshot, import ok

* Fixed height problem with issue action and issue tx, import NO

* Issue action reverted

* Added log and issueCounter for issue action

* Commented invoke snapshots, import ok

---------

Co-authored-by: Nikolay Eskov <[email protected]>

---------

Co-authored-by: Anton Ilin <[email protected]>
Co-authored-by: Nikolay Eskov <[email protected]>

* Added asset script special snapshot

* Added internal snapshot for script for issue tx

* Separated internal tx snapshots.

* Reduced 'internalSnapshot' interface, removed unnecessary code.

* Fixed improper usages of 'balances.wavesBalance': replaced by 'balances.newestWavesBalance'.

* Added invoke to snapshots, import ok, merged changes (#1236)

* Removed unnecessary 'assetFoundInMap' function.

* Changed 'LeaseStateSnapshot' according to the NODE-2626.

Add new internal snapshots:
- 'InternalLeaseStateActiveInfoSnapshot'
- 'InternalLeaseStateCancelInfoSnapshot'

* Use script from record in 'generateSnapshotsFromAssetsScriptsUncertain'.

* Removed unnecessary condition in 'blockSnapshotsApplier.ApplyAssetScript'.

* Removed unnecessary conditions in 'blockSnapshotsApplier.ApplyAccountScript'.

* Fixed bug with saved current ride estimator version in 'blockSnapshotsApplier.ApplyAccountScript'.

* Added invoke complexity update to internal snapshots

* Fixed PR issues

* Bump state version constant.

* Fixed new PR issues

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Nikolay Eskov <[email protected]>
Co-authored-by: Anton Ilin <[email protected]>
Co-authored-by: Alexey Kiselev <[email protected]>
Co-authored-by: Anton Ilin <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
nickeskov added a commit that referenced this pull request Nov 21, 2023
* Added types

* Renamed a file

* Changed asset- and waves balances structures

* Commented a function

* Changed addresses types

* Changed balanceAsset

* Added a constructor

* Added decimals to asset snapshot

* Changed uint8 to int8

* Added a field for asset reissuability

* Changed the type of total quantity

* removed the pointer

* Changed the type of orderID

* Make 'SnapshotManager' as an interface type.

* Replace 'proto.assetID' to 'crypto.Digest'.

* Replace 'proto.Address' to 'proto.WavesAddress'.

* Changed leaseID type

* changed types of leaseIn and leaseOut

* Removed the pointer types from AliasSnapshot

* Change a bit 'AtomicSnapshot' interface.

* Update snapshot types.

* Removed unnecessary fields in 'AccountScriptSnapshot' struct.

* Remove unnecessary types.

* Change 'StaticAssetInfoSnapshot.Issuer' field to 'StaticAssetInfoSnapshot.IssuerPublicKey'.

* Rename 'AssetReissuabilitySnapshot' to 'AssetVolumeSnapshot'.

* Add feature block reward distribution (#1082)

* add feature BlockRewardDistribution

* fix tests

* Improvement of the test on reward distribution to check that remainder of division goes to miner.

* refactor after rewiev

* fix feature info and add reward addresses in testnet and stagenet configs

* DAO and buyback addresses added for MainNet.
Formatting of settings files fixed.

---------

Co-authored-by: Alexey Kiselev <[email protected]>
Co-authored-by: Nikolay Eskov <[email protected]>

* change actions count with feature BlockRewardDistribution activated (#1088)

* change count actions with feature BlockRewardDistribution activated

* fix comment in script

* Merge fix.

* Fix version in comment

* Eth transaction refactoring and tests

---------

Co-authored-by: Alexey Kiselev <[email protected]>
Co-authored-by: Nikolay Eskov <[email protected]>

* Ride add rewards to block info (#1096)

* add feature BlockRewardDistribution

* fix tests

* Improvement of the test on reward distribution to check that remainder of division goes to miner.

* refactor after rewiev

* fix feature info and add reward addresses in testnet and stagenet configs

* change count actions with feature BlockRewardDistribution activated

* Ride version 7 added. Extended version of BlockInfo ride object added.
Ride types representation in objects stdlib description changed to simple string. Parsing of types added to code generation and updated in compiler.
Code generation updated to support Tuple types.

* Fixed code generation for RideV7. Fixed compilation of V7 scripts.
Added rewards structure and function to SmartState to get the block rewards.
Added test on script accessing new rewards field on BlockInfo.

* Fixed FunctionCall usage in tests

* Fixed sorting of rewards with stable sort.

* Script activation check added for RideV7.

* Code improvements

* Restored recursive check of list types in generated code.

* Generation of simplified code for tuple type checks.

* Duplicated tests removed

* Fixed lib version check in Ride compiler

---------

Co-authored-by: Anton Ilin <[email protected]>
Co-authored-by: Anton Ilin <[email protected]>

* Fix clear-text logging of sensitive information. (#1128)

* Bump golang.org/x/sync from 0.2.0 to 0.3.0 (#1129)

Bumps [golang.org/x/sync](https://github.com/golang/sync) from 0.2.0 to 0.3.0.
- [Commits](golang/sync@v0.2.0...v0.3.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sync
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alexey Kiselev <[email protected]>

* Added 'LeaseStateStatus'. Changed types in 'LeaseStateSnapshot'.

* Rename 'LeaseStateStatus.Status' to 'LeaseStateStatus.Value'.

* Add methods to 'SnapshotManager' interface. Changed 'AtomicSnapshot' interface.

* Snapshot applier (#1145)

* Create marshal/unmarshal methods for 'leasing' structure in 'pkg/state'.

* WIP: rollbackable map.

* Return 'balanceProfile' and 'wavesBalanceRecord' by value.

* Started 'snapshotApplier.'

* Add apply methods for assets snapshot applying.

* Add 'snapshotApplier.applySponsorship' method.

* Add 'snapshotApplier.applyAccountScript' method.

* Refactor 'ordersVolumes'.

* Add 'snapshotApplier.applyFilledVolumeAndFee' method.

* Add 'snapshotApplier.applyDataEntry' method.

* Add 'snapshotApplier.applyLeaseState' method.

* Revert "WIP: rollbackable map."

This reverts commit cb34969.

* Created and used 'SnapshotApplierInfo' interface in 'state' package.

* Create 'SnapshotApplier' interface in 'state' package.

* Refactor 'SnapshotApplier' interface.

* Remove 'SnapshotApplierInfo' interface.

* Extracted 'snapshotApplierStorages'.

* Rename 'ApplyDataEntry' to 'ApplyDataEntries'.

* Replace 'SnapshotManager' to 'SnapshotApplier'.

* Node transaction snapshots (#1078)

* Added a conversion function

* Added payment transaction conversion

* Added transfer tx conversion

* Transfer tx conversion changed

* Added issue and reissue tx conversions

* Issue

* Issue, reissue, burn, exchange

* Hanled lease transactions

* Finished performers

* Added snapshots for all types of transactions

* Fixed types after merging

* Fixed issue snapshot mistake

* Added rewards snapshot in append block

* Changed functions to newest

* Added snapshots from actions

* Removed todos

* Deleted useless code

* Fixed a mistake with leasing cancel

* Added tests for issue and reissue transactions

* Fixed tests

* fixed implicit memory aliasing

* Added tests for burn, lease, lease cancel, exchange and create alias transactions

* Added tests for data, sponsorship, set account and asset script transactions

* Added a test for the invoke transaction snapshots

* Fixed after merge

* Fixed a function

* Moved snapshot generation

* Remove 'SnapshotManager' interface.

* Added a todo

* Refactored perfomerInfo

* Refactored performer info again

* Moved generation to snapshot generator

* Fixed some linter issues

* Added an asset atomic snapshot for issue transaction

* Replaced current recording to storage to snapshot applier

* Replaced to snapshot applier, except balances

* Fixed a comment

* Removed the comment

* Removed unnecessary code

* Returned the linter command back

* Replaced current recording to storage to snapshot applier (#1162)

* Replaced current recording to storage to snapshot applier

* Replaced to snapshot applier, except balances

* Fixed a comment

* Removed the comment

* Removed unnecessary code

* Returned the linter command back

* Revert "Replaced current recording to storage to snapshot applier (#1162)" (#1164)

This reverts commit 51904b2.

* Added asset script atomic snapshot to the issue script actions

* Fixed some linter issues

* Fixed a few more linter issues

* Fixed all linter issues

* Fixed err shadowing

* Fixed a mistake with issue counter

* removed a useless line

* Fixed applying order transactions

* Fixed applying order transactions

* Added lising snapshot to the tx diff generated group

* Moved complexity saving into transaction performer

* Moved complexity saving into transaction performer

* removed a line

* Fixed a bug with an empty sender

* Used error.Is

* Set an empty script for issue with sig

* add snapshot storage

* fix some linter issues

* move snapshots types to proto

* fix linter issues

* Fixed a bug with wrong action sender

* Fixed a bug with wrong action sender

* use vtproto

* Add 'TransactionStatusSnapshot'.

* Implemented 'AtomicSnapshot' interface for 'TransactionStatusSnapshot'.

* Changed 'AssetScriptSnapshot' and 'scriptStorageState.setAssetScript'.

Removed 'pk' arg from 'setAssetScript'.
Removed two fields from 'AssetScriptSnapshot':
- 'SenderPK'
- 'Complexity'

* * Commented invoke snapshots, import ok (#1165)

* Replaced current recording to storage to snapshot applier

* Replaced to snapshot applier, except balances

* Fixed a comment

* Removed the comment

* Removed unnecessary code

* Returned the linter command back

* Added asset script atomic snapshot to the issue script actions

* Fixed some linter issues

* Fixed a few more linter issues

* Fixed all linter issues

* Fixed err shadowing

* Fixed a mistake with issue counter

* removed a useless line

* Fixed applying order transactions

* Fixed applying order transactions

* Added lising snapshot to the tx diff generated group

* Moved complexity saving into transaction performer

* Moved complexity saving into transaction performer

* removed a line

* Fixed a bug with an empty sender

* Used error.Is

* Set an empty script for issue with sig

* move snapshots types to proto

* Fixed a bug with wrong action sender

* Fixed a bug with wrong action sender

* Add 'TransactionStatusSnapshot'.

* Implemented 'AtomicSnapshot' interface for 'TransactionStatusSnapshot'.

* Changed 'AssetScriptSnapshot' and 'scriptStorageState.setAssetScript'.

Removed 'pk' arg from 'setAssetScript'.
Removed two fields from 'AssetScriptSnapshot':
- 'SenderPK'
- 'Complexity'

* * Commented invoke snapshots, import ok

* moved setting complexity and set script to snapshot applier

* Fixed a test and a mistake

* Fixed renaming

* Fixed a comment

* Moved dapp complexity to applier

* Added dapp complexity to set script as well

* Fixed a check mistake

* Fixed a test

* removed empty script check

* removed a todo

* Removed useless code

* Modified a test

* Fixed same keys issue for data entry actions

* Remove invoke snapshot (#1235)

* moved complexity back

* Reverted some changes, import ok

* Returned account script and asset script txs, import ?

* Uncommented internal snapshot, import ok

* Fixed height problem with issue action and issue tx, import NO

* Issue action reverted

* Added log and issueCounter for issue action

* Commented invoke snapshots, import ok

---------

Co-authored-by: Nikolay Eskov <[email protected]>

---------

Co-authored-by: Anton Ilin <[email protected]>
Co-authored-by: Nikolay Eskov <[email protected]>

* Added asset script special snapshot

* Added internal snapshot for script for issue tx

* add tx status snapshot to proto func

* remove unnecessary changes

* fix test

* Separated internal tx snapshots.

* Reduced 'internalSnapshot' interface, removed unnecessary code.

* add block snapshot

* remove some changes

* inc state version and fix some bugs

* fix marshall block snapshot

* Properly used 'binary.BigEndian.AppendUint32' in 'BlockSnapshot.MarshallBinary'.

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: esuwu <[email protected]>
Co-authored-by: Nikolay Eskov <[email protected]>
Co-authored-by: Alexey Kiselev <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alexandr Dolgavin <[email protected]>
nickeskov added a commit that referenced this pull request Apr 19, 2024
* Added types

* Renamed a file

* Changed asset- and waves balances structures

* Commented a function

* Changed addresses types

* Changed balanceAsset

* Added a constructor

* Added decimals to asset snapshot

* Changed uint8 to int8

* Added a field for asset reissuability

* Changed the type of total quantity

* removed the pointer

* Changed the type of orderID

* Make 'SnapshotManager' as an interface type.

* Replace 'proto.assetID' to 'crypto.Digest'.

* Replace 'proto.Address' to 'proto.WavesAddress'.

* Changed leaseID type

* changed types of leaseIn and leaseOut

* Removed the pointer types from AliasSnapshot

* Change a bit 'AtomicSnapshot' interface.

* Update snapshot types.

* Removed unnecessary fields in 'AccountScriptSnapshot' struct.

* Remove unnecessary types.

* Change 'StaticAssetInfoSnapshot.Issuer' field to 'StaticAssetInfoSnapshot.IssuerPublicKey'.

* Rename 'AssetReissuabilitySnapshot' to 'AssetVolumeSnapshot'.

* Add feature block reward distribution (#1082)

* add feature BlockRewardDistribution

* fix tests

* Improvement of the test on reward distribution to check that remainder of division goes to miner.

* refactor after rewiev

* fix feature info and add reward addresses in testnet and stagenet configs

* DAO and buyback addresses added for MainNet.
Formatting of settings files fixed.

---------

Co-authored-by: Alexey Kiselev <[email protected]>
Co-authored-by: Nikolay Eskov <[email protected]>

* change actions count with feature BlockRewardDistribution activated (#1088)

* change count actions with feature BlockRewardDistribution activated

* fix comment in script

* Merge fix.

* Fix version in comment

* Eth transaction refactoring and tests

---------

Co-authored-by: Alexey Kiselev <[email protected]>
Co-authored-by: Nikolay Eskov <[email protected]>

* Ride add rewards to block info (#1096)

* add feature BlockRewardDistribution

* fix tests

* Improvement of the test on reward distribution to check that remainder of division goes to miner.

* refactor after rewiev

* fix feature info and add reward addresses in testnet and stagenet configs

* change count actions with feature BlockRewardDistribution activated

* Ride version 7 added. Extended version of BlockInfo ride object added.
Ride types representation in objects stdlib description changed to simple string. Parsing of types added to code generation and updated in compiler.
Code generation updated to support Tuple types.

* Fixed code generation for RideV7. Fixed compilation of V7 scripts.
Added rewards structure and function to SmartState to get the block rewards.
Added test on script accessing new rewards field on BlockInfo.

* Fixed FunctionCall usage in tests

* Fixed sorting of rewards with stable sort.

* Script activation check added for RideV7.

* Code improvements

* Restored recursive check of list types in generated code.

* Generation of simplified code for tuple type checks.

* Duplicated tests removed

* Fixed lib version check in Ride compiler

---------

Co-authored-by: Anton Ilin <[email protected]>
Co-authored-by: Anton Ilin <[email protected]>

* Fix clear-text logging of sensitive information. (#1128)

* Bump golang.org/x/sync from 0.2.0 to 0.3.0 (#1129)

Bumps [golang.org/x/sync](https://github.com/golang/sync) from 0.2.0 to 0.3.0.
- [Commits](golang/sync@v0.2.0...v0.3.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sync
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alexey Kiselev <[email protected]>

* Added 'LeaseStateStatus'. Changed types in 'LeaseStateSnapshot'.

* Rename 'LeaseStateStatus.Status' to 'LeaseStateStatus.Value'.

* Add methods to 'SnapshotManager' interface. Changed 'AtomicSnapshot' interface.

* Snapshot applier (#1145)

* Create marshal/unmarshal methods for 'leasing' structure in 'pkg/state'.

* WIP: rollbackable map.

* Return 'balanceProfile' and 'wavesBalanceRecord' by value.

* Started 'snapshotApplier.'

* Add apply methods for assets snapshot applying.

* Add 'snapshotApplier.applySponsorship' method.

* Add 'snapshotApplier.applyAccountScript' method.

* Refactor 'ordersVolumes'.

* Add 'snapshotApplier.applyFilledVolumeAndFee' method.

* Add 'snapshotApplier.applyDataEntry' method.

* Add 'snapshotApplier.applyLeaseState' method.

* Revert "WIP: rollbackable map."

This reverts commit cb34969.

* Created and used 'SnapshotApplierInfo' interface in 'state' package.

* Create 'SnapshotApplier' interface in 'state' package.

* Refactor 'SnapshotApplier' interface.

* Remove 'SnapshotApplierInfo' interface.

* Extracted 'snapshotApplierStorages'.

* Rename 'ApplyDataEntry' to 'ApplyDataEntries'.

* Replace 'SnapshotManager' to 'SnapshotApplier'.

* Node transaction snapshots (#1078)

* Added a conversion function

* Added payment transaction conversion

* Added transfer tx conversion

* Transfer tx conversion changed

* Added issue and reissue tx conversions

* Issue

* Issue, reissue, burn, exchange

* Hanled lease transactions

* Finished performers

* Added snapshots for all types of transactions

* Fixed types after merging

* Fixed issue snapshot mistake

* Added rewards snapshot in append block

* Changed functions to newest

* Added snapshots from actions

* Removed todos

* Deleted useless code

* Fixed a mistake with leasing cancel

* Added tests for issue and reissue transactions

* Fixed tests

* fixed implicit memory aliasing

* Added tests for burn, lease, lease cancel, exchange and create alias transactions

* Added tests for data, sponsorship, set account and asset script transactions

* Added a test for the invoke transaction snapshots

* Fixed after merge

* Fixed a function

* Moved snapshot generation

* Remove 'SnapshotManager' interface.

* Added a todo

* Refactored perfomerInfo

* Refactored performer info again

* Moved generation to snapshot generator

* Fixed some linter issues

* Added an asset atomic snapshot for issue transaction

* Replaced current recording to storage to snapshot applier

* Replaced to snapshot applier, except balances

* Fixed a comment

* Removed the comment

* Removed unnecessary code

* Returned the linter command back

* Replaced current recording to storage to snapshot applier (#1162)

* Replaced current recording to storage to snapshot applier

* Replaced to snapshot applier, except balances

* Fixed a comment

* Removed the comment

* Removed unnecessary code

* Returned the linter command back

* Revert "Replaced current recording to storage to snapshot applier (#1162)" (#1164)

This reverts commit 51904b2.

* Added asset script atomic snapshot to the issue script actions

* Fixed some linter issues

* Fixed a few more linter issues

* Fixed all linter issues

* Fixed err shadowing

* Fixed a mistake with issue counter

* removed a useless line

* Fixed applying order transactions

* Fixed applying order transactions

* Added lising snapshot to the tx diff generated group

* Moved complexity saving into transaction performer

* Moved complexity saving into transaction performer

* removed a line

* Fixed a bug with an empty sender

* Used error.Is

* Set an empty script for issue with sig

* add light node states

* add snapshot storage

* fix some linter issues

* move snapshots types to proto

* fix linter issues

* Fixed a bug with wrong action sender

* Fixed a bug with wrong action sender

* use vtproto

* Add 'TransactionStatusSnapshot'.

* Implemented 'AtomicSnapshot' interface for 'TransactionStatusSnapshot'.

* Changed 'AssetScriptSnapshot' and 'scriptStorageState.setAssetScript'.

Removed 'pk' arg from 'setAssetScript'.
Removed two fields from 'AssetScriptSnapshot':
- 'SenderPK'
- 'Complexity'

* * Commented invoke snapshots, import ok (#1165)

* Replaced current recording to storage to snapshot applier

* Replaced to snapshot applier, except balances

* Fixed a comment

* Removed the comment

* Removed unnecessary code

* Returned the linter command back

* Added asset script atomic snapshot to the issue script actions

* Fixed some linter issues

* Fixed a few more linter issues

* Fixed all linter issues

* Fixed err shadowing

* Fixed a mistake with issue counter

* removed a useless line

* Fixed applying order transactions

* Fixed applying order transactions

* Added lising snapshot to the tx diff generated group

* Moved complexity saving into transaction performer

* Moved complexity saving into transaction performer

* removed a line

* Fixed a bug with an empty sender

* Used error.Is

* Set an empty script for issue with sig

* move snapshots types to proto

* Fixed a bug with wrong action sender

* Fixed a bug with wrong action sender

* Add 'TransactionStatusSnapshot'.

* Implemented 'AtomicSnapshot' interface for 'TransactionStatusSnapshot'.

* Changed 'AssetScriptSnapshot' and 'scriptStorageState.setAssetScript'.

Removed 'pk' arg from 'setAssetScript'.
Removed two fields from 'AssetScriptSnapshot':
- 'SenderPK'
- 'Complexity'

* * Commented invoke snapshots, import ok

* moved setting complexity and set script to snapshot applier

* Fixed a test and a mistake

* Fixed renaming

* Fixed a comment

* Moved dapp complexity to applier

* Added dapp complexity to set script as well

* Fixed a check mistake

* Fixed a test

* removed empty script check

* removed a todo

* Removed useless code

* Modified a test

* Fixed same keys issue for data entry actions

* Remove invoke snapshot (#1235)

* moved complexity back

* Reverted some changes, import ok

* Returned account script and asset script txs, import ?

* Uncommented internal snapshot, import ok

* Fixed height problem with issue action and issue tx, import NO

* Issue action reverted

* Added log and issueCounter for issue action

* Commented invoke snapshots, import ok

---------

Co-authored-by: Nikolay Eskov <[email protected]>

---------

Co-authored-by: Anton Ilin <[email protected]>
Co-authored-by: Nikolay Eskov <[email protected]>

* Added asset script special snapshot

* Added internal snapshot for script for issue tx

* add tx status snapshot to proto func

* remove unnecessary changes

* fix test

* Separated internal tx snapshots.

* Reduced 'internalSnapshot' interface, removed unnecessary code.

* add new add block with snapshot

* add light node

* fix linter issue

* fix tests

* fix ng state

* fix some bugs

* Merge fix

* fix issues

* fix tests

* fix itests

* add add block with snpashots and new states for snapshots

* fix test

* Add snapshot hash check for 'txAppender.appendBlock'.

* Timeout tasks for wait snapshot states of FSM can be cancelled.

* remove copypasts

* Fixed bug in 'MicroBlockCache.GetSnapshot'.

* Add block snapshots as an optional return parameter for 'newBlocks.current'.

* move snapshot requests to defer

* Refactor a bit 'newBlocks.current'.

* Linter fixes.

* Remove irrelevant TODO.

* fix channel size for proto msgs

* Fix light node fee distribution (#1341)

* Fix TODO comment in 'snapshot_generator_internal_test.go'.

* Use 'error.As' in 'wrapErr' func according to the linter recommendation.

* Use 'errors.Is' according to the linter recommendation.

* Rename 'needToRecalc' variable to 'needToRecalculate'.

* Add 'default' case for 'switch' in 'txAppender.handleFallible'.

* Add TODO for 'txAppender.applySnapshotInLightNode'.

* Refactor 'newStateManager' function.

* Reuse 'currentBlockInfo' struct in 'applySnapshotInLightNode' and 'appendTxs' methods of 'txAppender'.

* Coun miner fee while processing transactions snapshots in 'txAppender.applySnapshotInLightNode'.

* Count miner fees after transactions processing.

* Fix mistake with wrapping wrong error variable while calculating miner's fees.

* Count miner tx fee after tx application.

* Count miner tx fees in 'commitTxApplication'.

* fix other channel size

* fix state name

* Add 'cleanupBeforeTransition' deferred calls for 'WaitMicroSnapshotState' and 'WaitSnapshotState'.

* Simplified a bit 'syncSkipMessageList' for SYNC in full mode

* fix microBlockSnapshot state name

* initialize snapshot chache

* fix linter

* fix linters

* Add snapshots to importer (#1290)

* Added snapshots import to importer

* Added flags

* Added snapshots to importer

* Importer refactoring. Extracted blockReader and snapshotReader.
Linter errors fixed. Blockchain scheme fixed.

* Linter action version updated.

* Golangci-lint version updated to 1.55.2.

* Importer global refactoring.

* Use new min and max fucntions from Go 1.21.

* Unused newSnapshots type removed.

* Small style fix.
Additional check on data size while deserializing snapshots.

---------

Co-authored-by: Alexey Kiselev <[email protected]>

* Fix gosec issues.

* return to ng if failed to apply block/microblock

* add Score in WaitSnapshots States

* fix Score check func and reduce timeouts

* increse message max lenght and allow negative in/out in lease balance snapshot

* fix asset volume decode/encode

* fix linters

* move ask blockIDs

* fix linters

* Fix log records.

* Fix 'TestTxSnapshotHasher'.

* Add new testcase for 'TestTxSnapshotMarshalToPBAndUnmarshalFromPB'.

* Remove unnecessary closure from 'selectImporter' im 'cmd/importer/importer.go'.

* Optimized a bit 'BlockSnapshot.ToProtobuf'.

* Optimized a bit 'NGState.checkAndAppendMicroBlock'.

* Optimized a bit 'WaitMicroSnapshotState.checkAndAppendMicroBlock'.

* rewrite ApplyFromFile in importer and fix some issues

* Remove 'nolint' for 'ProtocolVersion' func.

* Add more logs in 'ApplyFromFile' func.

* Add sanity checks for 'ImportParams'.

* Properly handle error in 'processScoreAfterApplyingOrReturnToNG'.

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: esuwu <[email protected]>
Co-authored-by: Nikolay Eskov <[email protected]>
Co-authored-by: Alexey Kiselev <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alexandr Dolgavin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wip This is a WIP, should not be merged right away
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants