Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
39bad3a
adding checks at fullnode side while intial syncing.
KryptSai Dec 29, 2025
1c1f1a3
improving the validation condition and log messages.
KryptSai Dec 30, 2025
df9d2bc
adding reason column in the failed to sync tokens table; improving va…
KryptSai Dec 30, 2025
ba6b3d6
adding a function to get a block by blocknumber; changing attribute …
KryptSai Jan 7, 2026
ffe82fa
adding fullnodemultiplechildtokenstable; adding parenttokenID column…
KryptSai Jan 8, 2026
c37cb87
handling some cases in processReceivedTokenDetails, if there are erro…
KryptSai Jan 8, 2026
93673a7
adding signature check at fullnode side;
KryptSai Jan 19, 2026
832838f
handling the case where 2 blocks with the same block number but with …
KryptSai Jan 19, 2026
2ff4493
fixing the issue of token value not getting updated if the genesis bl…
KryptSai Jan 21, 2026
5ed4513
adding logs to debug the signature verification failed in validate si…
KryptSai Jan 27, 2026
f059be0
Handled the case where Fullnode already has more blocks than the inco…
KryptSai Feb 4, 2026
25f62e4
Modified the remove token chain api such a way that we can remove a p…
KryptSai Feb 5, 2026
7df38fd
Merge branch 'development' into sai/checks-at-fullnode
KryptSai Feb 5, 2026
2771c01
modifying the ValidateNewTokenContent function such a way that it be…
KryptSai Feb 6, 2026
461bc29
Merge branch 'development' into sai/checks-at-fullnode
KryptSai Feb 6, 2026
b7a8b4e
Removed code related to adding token content to psql in fullnode; so…
KryptSai Feb 6, 2026
67951df
Merge branch 'development' into sai/checks-at-fullnode
KryptSai Feb 9, 2026
d8cde7c
adding MaxPossiblePartsIndexByMaxDecimalPlaces function;
KryptSai Feb 10, 2026
f617a92
Added startIndex as a flag with default value -1 to generate test rbt;
KryptSai Feb 10, 2026
d36594a
handled a small error in GenerateRBT function;
KryptSai Feb 10, 2026
95a711f
Merge branch 'development' into sai/checks-at-fullnode
KryptSai Feb 10, 2026
78a8683
removing unnecessary code
KryptSai Feb 10, 2026
d76120f
handling the case where publisher has less token chain length compare…
KryptSai Feb 11, 2026
686dfd2
Adding missing block checks and validating incoming block in case of …
KryptSai Feb 11, 2026
d6052c5
handling invalid token error in dumptokenchain for non native asset t…
KryptSai Feb 12, 2026
c4f8da2
In processContractExecution adding token details to FullNode's postgr…
KryptSai Feb 12, 2026
c44f8a5
handling errors of SyncFullTokenChainForFullNode function;
KryptSai Feb 13, 2026
127be76
adding HandleSyncErrorAsDoubleSpent to handle sync token chain error…
KryptSai Feb 13, 2026
ee02743
updated tokenMap according to the recent white paper; updated generat…
KryptSai Feb 16, 2026
00ee5e6
Revert "updated tokenMap according to the recent white paper; updated…
KryptSai Feb 17, 2026
ad48f48
Merge branch 'development' into sai/checks-at-fullnode
KryptSai Feb 17, 2026
609e630
commented out RetryFailedTOSyncTokens for fullnode which was running …
KryptSai Feb 17, 2026
3cda0bf
modified token genuinity check according to new test net token genera…
KryptSai Feb 17, 2026
f322858
Merge branch 'development' into sai/checks-at-fullnode
KryptSai Feb 23, 2026
439556d
removing unnecessary loggers and commented out code.
KryptSai Feb 23, 2026
f1e11e1
removed a debug statement.
KryptSai Feb 23, 2026
992b45a
return error when it has not been handled in case of calling HandleSy…
KryptSai Feb 23, 2026
6c5319c
added block number check for genesis blocks at fullnode side; added t…
KryptSai Feb 25, 2026
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
7 changes: 4 additions & 3 deletions client/diagnostic.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,11 @@ func (c *Client) GetNFTTokenData(token string, latest bool) (*model.NFTDataReply

}

func (c *Client) RemoveTokenChainBlock(token string, latest bool) (*model.TCRemoveReply, error) {
func (c *Client) RemoveTokenChainBlock(token string, latest bool, blockID string) (*model.TCRemoveReply, error) {
removeReq := &model.TCRemoveRequest{
Token: token,
Latest: latest,
Token: token,
Latest: latest,
BlockID: blockID,
}
var removeReply model.TCRemoveReply
err := c.sendJSONRequest("POST", setup.APIRemoveTokenChainBlock, nil, removeReq, &removeReply)
Expand Down
6 changes: 1 addition & 5 deletions command/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ type Command struct {
rawCodePath string
smartContractToken string
newContractBlock string
BlockID string
publishType int
smartContractData string
executorAddr string
Expand Down Expand Up @@ -628,11 +629,6 @@ func (cmd *Command) runApp() {
c.SubscribeTCDetails()
}

// Start background job: retry failed-to-sync tokens every 1 hour
if cmd.fullNode {
c.RetryFailedTokenSync()
}

ch := make(chan os.Signal, 1)
signal.Notify(ch, syscall.SIGTERM)
signal.Notify(ch, syscall.SIGINT)
Expand Down
13 changes: 8 additions & 5 deletions command/diagnostic.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,13 @@ func (cmd *Command) dumpTokenChain() {
}
}

elems := strings.Split(cmd.token, "_")
if len(elems) < 2 {
cmd.log.Error(fmt.Sprintf("Invalid token: %v", cmd.token))
return
if cmd.assetType == "rbt" {
elems := strings.Split(cmd.token, "_")
if len(elems) < 2 {
cmd.log.Error(fmt.Sprintf("Invalid token: %v", cmd.token))
return
}

}

blocks := make([]map[string]interface{}, 0)
Expand Down Expand Up @@ -414,7 +417,7 @@ func (cmd *Command) getSmartContractData() {
}

func (cmd *Command) removeTokenChainBlock() {
response, err := cmd.c.RemoveTokenChainBlock(cmd.token, cmd.latest)
response, err := cmd.c.RemoveTokenChainBlock(cmd.token, cmd.latest, cmd.BlockID)
if err != nil {
cmd.log.Error("Failed to remove token chain", "err", err)
return
Expand Down
44 changes: 22 additions & 22 deletions core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -986,25 +986,25 @@ func (c *Core) tokenSyncCleanupRoutine() {
}
}

func (c *Core) RetryFailedTokenSync() {
go func() {
c.RetryTokenSyncTicker = time.NewTicker(1 * time.Hour)
defer c.RetryTokenSyncTicker.Stop()

for range c.RetryTokenSyncTicker.C {
retryErrChan := make(chan error, 1)
go func() {
retryErrChan <- c.RetryFailedTOSyncTokens()
}()

err := <-retryErrChan
if err != nil {
c.log.Error("RetryFailedTOSyncTokens execution failed", "err", err)
} else {
c.log.Info("RetryFailedTOSyncTokens executed successfully")
}

}

}()
}
// func (c *Core) RetryFailedTokenSync() {
// go func() {
// c.RetryTokenSyncTicker = time.NewTicker(1 * time.Hour)
// defer c.RetryTokenSyncTicker.Stop()

// for range c.RetryTokenSyncTicker.C {
// retryErrChan := make(chan error, 1)
// go func() {
// retryErrChan <- c.RetryFailedTOSyncTokens()
// }()

// err := <-retryErrChan
// if err != nil {
// c.log.Error("RetryFailedTOSyncTokens execution failed", "err", err)
// } else {
// c.log.Info("RetryFailedTOSyncTokens executed successfully")
// }

// }

// }()
// }
21 changes: 21 additions & 0 deletions core/diagnostic.go
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,27 @@ func (c *Core) RemoveTokenChainBlock(removeReq *model.TCRemoveRequest) *model.TC
if c.testNet {
tt = token.TestTokenType
}
if removeReq.BlockID != "" {
err := c.w.RemoveTokenChainBlock(removeReq.Token, tt, removeReq.BlockID)
if err != nil {
tt = token.PartTokenType
if c.testNet {
tt = token.TestPartTokenType
}
err = c.w.RemoveTokenChainBlock(removeReq.Token, tt, removeReq.BlockID)
if err != nil {
removeReply.Message = "Failed to remove parts token chain block"
return removeReply
} else {
removeReply.Message = "Failed to remove whole token chain block"
return removeReply
}

}
removeReply.Status = true
removeReply.Message = "Successfully removed token chain block " + removeReq.Token
return removeReply
}
err := c.w.RemoveTokenChainBlocklatest(removeReq.Token, tt)
if err != nil {
tt = token.PartTokenType
Expand Down
2 changes: 1 addition & 1 deletion core/did.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ func (c *Core) GetPeerDIDInfo(didStr string) (*wallet.DIDPeerMap, error) {
didType, _ = c.w.GetPeerDIDType(didStr)

if peerID != "" && didType != -1 {
//c.log.Debug("Found peer info in local storage", "peerID", peerID, "didType", didType)
c.log.Debug("Found peer info in local storage", "peerID", peerID, "didType", didType)
return &wallet.DIDPeerMap{
DID: didStr,
PeerID: peerID,
Expand Down
Loading