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

ExceptionFormatter 직렬화 에러 수정 #2959

Closed
eugene-doobu opened this issue Oct 29, 2024 · 3 comments · Fixed by #2963
Closed

ExceptionFormatter 직렬화 에러 수정 #2959

eugene-doobu opened this issue Oct 29, 2024 · 3 comments · Fixed by #2963
Assignees
Labels
bug Something isn't working
Milestone

Comments

@eugene-doobu
Copy link
Member

ExceptionFormatter에서 MessagePack을 통해 예외 관련 내용을 Serialize/Deserialize 처리를 해주고 있다.
근데 이 Serialize된 결과물을 Deserialize 하지 못해주는 경우가 있음

Libplanet.Action.UnexpectedlyTerminatedActionException
Mesage:The action Nekoyume.Action.TransferAsset (block #12263717, pre-evaluation hash 8b95f79000bbf4d8ea94518414daf9fb259309fd70a5c86acd8ce48205702dce, tx 04a5c521d0c1540e70c9a5877f13d7e746582e93b561a15388ec3092849df139 threw an exception during execution. See also this exception's InnerException property
data: null
-- stack+1
Mesage: Cannot burn or transfer 0.01 NCG from 0x0b8ac00f614985693EfcD80E3b8124c98ae541EB as the current balance of 0x0b8ac00f614985693EfcD80E3b8124c98ae541EB is 0 NCG.
data: null
InnerException: null
StackTraceString: at Libplanet.Action.State.CurrencyAccount.TransferRawAssetV7(Address sender, Address recipient, BigInteger rawValue) in /app/Lib9c/.Libplanet/src/Libplanet.Action/State/CurrencyAccount.cs:line 270
at Nekoyume.Action.TransferAsset.Execute(IActionContext context) in /app/Lib9c/Lib9c/Action/TransferAsset.cs:line 86
at Libplanet.Action.ActionEvaluator.EvaluateAction(IPreEvaluationBlock block, ITransaction tx, IActionContext context, IAction action, IStateStore stateStore, Boolean isPolicyAction, ILogger logger) in /app/Lib9c/.Libplanet/src/Libplanet.Action/ActionEvaluator.cs:line 303
HResult: -2146233088
Source: Libplanet.Action
Address: Exception

Message: The account 0x0784263E46610B5aEaA410eD84d997D50e3b8833's balance of Mead (c722affab6098bf84ebe0afb69a748c2dc2a4d63) isinsufficient to pay gas fee: 0 Mead < 1 Mead.
at Libplanet.Action.FeeCollector.Mortgage(IWorld world) in /app/Lib9c/.Libplanet/src/Libplanet.Action/FeeCollector.cs:line 80
at Libplanet.Action.ActionEvaluator.EvaluateAction(IPreEvaluationBlock block, ITransaction tx, IActionContext context, IAction action, IStateStore stateStore, Boolean isPolicyAction, ILogger logger)
Source: Libplanet.Action

두 액션에서 Serialize된 Exception정보를 읽어오는 과정에서 "name: Address"키의 값이 'LibPlanet.Crypto.Address'인 경우 타입을 찾지 못하고 예외 발생

@eugene-doobu eugene-doobu self-assigned this Oct 29, 2024
@eugene-doobu
Copy link
Member Author

  1. Libplanet의 custom Exception에서 GetObjectData메서드를 오버라이드하여 libplanet assembly에 포함되어있는 타입 정보를 기록
  2. 이를 Serialization단에서 libplaent assembly에 있는 타입 정보를 그대로 직렬화
  3. 다른 assembly(lib9c)단에서 이를 해석하지 못하고 있음

@eugene-doobu
Copy link
Member Author

타입 해석할때 다른 어셈블리 가져오면 깔끔해결인디 쓸데없이 무거운거같아서 직렬화 방법 자체를 수정하려고 합니다

@eugene-doobu
Copy link
Member Author

추가 + lib9c 테스트 코드에서 예외 줍줍해서 터지는거 보고 수정하기

@eugene-doobu eugene-doobu linked a pull request Oct 29, 2024 that will close this issue
@eugene-doobu eugene-doobu added the bug Something isn't working label Oct 29, 2024
@eugene-doobu eugene-doobu added this to the v250.0.0 milestone Oct 29, 2024
@github-project-automation github-project-automation bot moved this from Review to Done in Nine Chronicles Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant