Skip to content

Comments

morph: improve notary events parsing#3813

Open
AnnaShaleva wants to merge 7 commits intomasterfrom
import-parsing
Open

morph: improve notary events parsing#3813
AnnaShaleva wants to merge 7 commits intomasterfrom
import-parsing

Conversation

@AnnaShaleva
Copy link
Member

@AnnaShaleva AnnaShaleva commented Feb 11, 2026

TODO:

  • Fetch fresh NeoGo.
  • Remove intermediate TODOs from code.
  • Test via NeoFS testsuit and ensure nothing is broken.

@codecov
Copy link

codecov bot commented Feb 12, 2026

Codecov Report

❌ Patch coverage is 2.10526% with 279 lines in your changes missing coverage. Please review.
✅ Project coverage is 25.45%. Comparing base (5f9fef8) to head (123dbc9).

Files with missing lines Patch % Lines
pkg/morph/event/container/notary_requests.go 0.00% 108 Missing ⚠️
pkg/morph/event/netmap/add_peer_notary.go 0.00% 42 Missing ⚠️
pkg/morph/event/container/put_notary.go 0.00% 37 Missing ⚠️
pkg/morph/event/reputation/put_notary.go 0.00% 22 Missing ⚠️
pkg/morph/event/container/eacl_notary.go 0.00% 16 Missing ⚠️
pkg/morph/event/container/delete_notary.go 0.00% 13 Missing ⚠️
pkg/morph/event/netmap/update_peer_notary.go 0.00% 12 Missing ⚠️
pkg/morph/event/parsers.go 0.00% 12 Missing ⚠️
pkg/morph/event/container/object_notary.go 0.00% 6 Missing ⚠️
pkg/morph/event/container/put.go 0.00% 6 Missing ⚠️
... and 1 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3813      +/-   ##
==========================================
- Coverage   25.53%   25.45%   -0.09%     
==========================================
  Files         669      668       -1     
  Lines       42940    42846      -94     
==========================================
- Hits        10966    10906      -60     
+ Misses      30971    30946      -25     
+ Partials     1003      994       -9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@AnnaShaleva
Copy link
Member Author

Testsuit run is in progress, but the PR itself is ready for review.

@AnnaShaleva AnnaShaleva marked this pull request as ready for review February 12, 2026 11:08
@AnnaShaleva AnnaShaleva added this to the v0.51.1 milestone Feb 12, 2026
@AnnaShaleva AnnaShaleva added the enhancement Improving existing functionality label Feb 12, 2026
@roman-khimov roman-khimov modified the milestones: v0.51.1, v0.52.0 Feb 12, 2026
@AnnaShaleva
Copy link
Member Author

No functional changes.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
Replace custom AppCall argument parsers with built-in NeoGo's ones.

Other related functional changes:
1. Remove container.PutNamed structure since it duplicates
   container.Put functionality starting from c6c6aea.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
This type argument is excessive and misleading since scparser doesn't
operate with VM types. Also, scparser offers detailed error information
by himsel, no further extension is necessary.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
It's used in two places, and it's a duplicate of
event.WrongNumberOfParameters.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
Parsers from `pkg/morph/event/...` will reuse this common code.
No functional changes.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
Reuse `event.GetValueFromArg`, `event.GetArgs` and
`event.WrapInvalidArgError` where possible. Take care of errors text,
unify invalid argument errors, remove excessive information.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
This code complicates things for nothing and may lead to bugs related to
structure fields order initialization. Raw parsing is more clear and
takes less space.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
@AnnaShaleva
Copy link
Member Author

@nspcc-dev/neofs-core updated, ready for review.

}

// CreateContainerRequest wraps container creation request to provide
// CreateContainerV2Request wraps container creation request to provide
Copy link
Member

Choose a reason for hiding this comment

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

Nice, but unrelated.

err error
)

if err = res.Container.FromStackItem(stack.Pop().Item()); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

Just as a thought: type Item interface can be implemented by Instruction as well (all type switches based on specific stackitems will go wild though).

func ParsePutNotary(ne event.NotaryEvent) (event.Event, error) {
var ev Put
const putArgCnt = 3
var ev = new(Put)
Copy link
Member

Choose a reason for hiding this comment

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

Why this one?

### Changed
- SN retries notary requests if `insufficient amount of gas` error appears (#3739)
- Speed up metabase resync by using batch operations (#3804)
- Notary events parsing is now done via NeoGo `scparser` package (#3813)
Copy link
Member

Choose a reason for hiding this comment

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

Not sure it's worth mentioning at all, it's deeply internal to node. And this is outdated wrt 0.51.1 release as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improving existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants