Skip to content

Commit

Permalink
Removed temporary fix
Browse files Browse the repository at this point in the history
  • Loading branch information
esuwu committed Dec 26, 2024
1 parent 2e2d3d8 commit 8aeff69
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 deletions.
13 changes: 4 additions & 9 deletions pkg/state/appender.go
Original file line number Diff line number Diff line change
Expand Up @@ -846,12 +846,7 @@ func (a *txAppender) appendBlock(params *appendBlockParams) error {
if a.bUpdatesExtension != nil && a.bUpdatesExtension.EnableBlockchainUpdatesPlugin() {
// TODO get info from block snapshot?

// blockSnapshot.TxSnapshots.

updtErr := a.updateBlockchainUpdateInfo(blockInfo, params.block, blockSnapshot)
if updtErr != nil {
return updtErr
}
a.updateBlockchainUpdateInfo(blockInfo, params.block, blockSnapshot)
}

// check whether the calculated snapshot state hash equals with the provided one
Expand All @@ -876,7 +871,7 @@ func (a *txAppender) appendBlock(params *appendBlockParams) error {
}

func (a *txAppender) updateBlockchainUpdateInfo(blockInfo *proto.BlockInfo, blockHeader *proto.BlockHeader,
blockSnapshot proto.BlockSnapshot) error {
blockSnapshot proto.BlockSnapshot) {
blockID := blockHeader.BlockID()
bUpdatesInfo := blockchaininfo.BUpdatesInfo{
BlockUpdatesInfo: blockchaininfo.BlockUpdatesInfo{
Expand All @@ -897,13 +892,13 @@ func (a *txAppender) updateBlockchainUpdateInfo(blockInfo *proto.BlockInfo, bloc
if dataEntriesSnapshot, ok := snapshot.(*proto.DataEntriesSnapshot); ok {
if dataEntriesSnapshot.Address == a.bUpdatesExtension.L2ContractAddress() {
l2ContractCount++
bUpdatesInfo.ContractUpdatesInfo.AllDataEntries = append(bUpdatesInfo.ContractUpdatesInfo.AllDataEntries, dataEntriesSnapshot.DataEntries...)
bUpdatesInfo.ContractUpdatesInfo.AllDataEntries = append(bUpdatesInfo.ContractUpdatesInfo.AllDataEntries,
dataEntriesSnapshot.DataEntries...)
}
}
}
}
a.bUpdatesExtension.WriteBUpdates(bUpdatesInfo)
return nil
}

func (a *txAppender) createCheckerInfo(params *appendBlockParams) (*checkerInfo, error) {
Expand Down
18 changes: 9 additions & 9 deletions pkg/state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,15 +229,15 @@ func (s *blockchainEntitiesStorage) flush() error {
var ErrIncompatibleStateParams = stderrs.New("incompatible state params")

func checkCompatibility(stateDB *stateDB, params StateParams) error {
//version, err := stateDB.stateVersion()
//if err != nil {
// return errors.Wrap(err, "stateVersion")
//}
//if version != StateVersion {
// return errors.Wrapf(ErrIncompatibleStateParams, "incompatible storage version: state has value (%d), want (%d)",
// version, StateVersion,
// )
//}
version, err := stateDB.stateVersion()
if err != nil {
return errors.Wrap(err, "stateVersion")
}
if version != StateVersion {
return errors.Wrapf(ErrIncompatibleStateParams, "incompatible storage version: state has value (%d), want (%d)",
version, StateVersion,
)
}
hasDataForExtendedApi, err := stateDB.stateStoresApiData()
if err != nil {
return errors.Wrap(err, "stateStoresApiData")
Expand Down

0 comments on commit 8aeff69

Please sign in to comment.